ff7tk  0.02
Toolkit for making FF7 Tools
ItemSelector.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // copyright 2012 - 2016 Chris Rizzitello <sithlord48@gmail.com> //
3 // //
4 // This file is part of FF7tk //
5 // //
6 // FF7tk is free software: you can redistribute it and/or modify //
7 // it under the terms of the GNU General Public License as published by //
8 // the Free Software Foundation, either version 3 of the License, or //
9 // (at your option) any later version. //
10 // //
11 // FF7tk is distributed in the hope that it will be useful, //
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14 // GNU General Public License for more details. //
15 /****************************************************************************/
16 #ifndef ITEMSELECTOR_H
17 #define ITEMSELECTOR_H
18 
19 #include "qglobal.h"
20 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
21  #include <QtWidgets>
22 #else
23  #include <QtGui>
24 #endif
25 
26 //Include Data class
27 #include "../data/FF7Item.h"
28 
29 class ItemSelector : public QWidget
30 {
31  Q_OBJECT
32 public:
33  explicit ItemSelector(qreal Scale=1,QWidget *parent = 0);
34  int id();// current id
35  int combo_item_width();//width of the item box.
36  int combo_type_width();//width of the type box.
37  int qty_width();//width of qty area.
38  void setFixedHeight(int h);
39 signals:
40  void item_changed(quint16);//return selected rawitem
41 public slots:
42  void setCurrentItem(quint16 ff7item);
43  void setCurrentItem(int id,int qty);
44  void setMaximumQty(int maxQty);
45  void setEditableItemCombo(bool editable);
46 private slots:
47  void setFilter(int type);
48  void comboItem_changed(int index);
49  void sb_qty_changed(int qty);
50  void btn_remove_clicked();
51 private:
52  void init_display();
53  void init_connections();
54  void init_data();
55  int type_offset(int type);
57  QComboBox *combo_type;
58  QComboBox *combo_item;
59  QSpinBox *sb_qty;
60  QPushButton *btn_remove;
61  quint16 current_item;
62  qreal scale;
63 };
64 #endif // ITEMSELECTOR_H
void setFilter(int type)
void setCurrentItem(quint16 ff7item)
void init_display()
void item_changed(quint16)
QSpinBox * sb_qty
Definition: ItemSelector.h:59
Class containg all kinds of info about items in FF7.
Definition: FF7Item.h:99
void sb_qty_changed(int qty)
quint16 current_item
Definition: ItemSelector.h:61
int combo_item_width()
FF7Item * Items
Definition: ItemSelector.h:56
void setEditableItemCombo(bool editable)
int type_offset(int type)
void init_data()
QComboBox * combo_item
Definition: ItemSelector.h:58
QPushButton * btn_remove
Definition: ItemSelector.h:60
void setFixedHeight(int h)
void setMaximumQty(int maxQty)
void comboItem_changed(int index)
ItemSelector(qreal Scale=1, QWidget *parent=0)
void btn_remove_clicked()
int combo_type_width()
void init_connections()
QComboBox * combo_type
Definition: ItemSelector.h:57