- Timestamp:
- May 17, 2006, 11:10:02 AM (19 years ago)
- Location:
- branches/qt_gui/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/event/key_mapper.h
r7635 r7637 20 20 typedef struct KeyMapping 21 21 { 22 int* pValue;22 int* pValue; 23 23 const std::string pName; 24 24 }; … … 32 32 void loadKeyBindings(IniParser* iniParser); 33 33 34 static const KeyMapping* constgetKeyMapping() { return KeyMapper::map; };34 static const KeyMapping* getKeyMapping() { return KeyMapper::map; }; 35 35 36 36 void debug(); -
branches/qt_gui/src/lib/gui/qt_gui/gui_control.cc
r7636 r7637 46 46 47 47 { 48 QLabel* keyLabel = new QLabel;48 //QLabel* keyLabel = new QLabel; 49 49 50 const KeyMapper::KeyMapping* map = KeyMapper::getKeyMapping(); 51 unsigned int i = 0; 52 while(!map->pName.empty()) 53 { 54 QLabel* label = new QLabel(QString().fromStdString(map->pName)); 55 layout->addWidget(label, i, 0); 50 56 57 GuiControlInput* input = new GuiControlInput(map->pName, this, "test"); 58 layout->addWidget(input, i, 1); 51 59 60 ++map; 61 ++i; 62 } 52 63 53 64 } … … 64 75 } 65 76 77 GuiControlInput::GuiControlInput(const std::string& name, SaveableGroup* group, const std::string& defaultValue) 78 : QPushButton(QString().fromStdString(name)), Saveable(name, group, defaultValue) 79 { 80 } 81 82 void GuiControlInput::load() 83 { 84 Saveable::load(); 85 this->setText(QString().fromStdString(this->value().getString())); 86 } 87 void GuiControlInput::save() 88 { 89 this->value() = this->text().toStdString(); 90 Saveable::save(); 91 } 92 93 66 94 } -
branches/qt_gui/src/lib/gui/qt_gui/gui_control.h
r7636 r7637 10 10 #include <string> 11 11 #include <QtGui/QGroupBox> 12 #include <QtGui/QPushButton> 12 13 #include "../gui_saveable.h" 13 14 … … 24 25 }; 25 26 26 class GuiControlInput : public Q GroupBox, public OrxGui::Saveable27 class GuiControlInput : public QPushButton, public OrxGui::Saveable 27 28 { 28 29 Q_OBJECT 30 public: 29 31 GuiControlInput(const std::string& name, SaveableGroup* group, const std::string& defaultValue); 30 32 31 public slots: 33 virtual void load(); 34 virtual void save(); 32 35 33 signals: 34 void optionChanged(); 36 public slots: 37 38 signals: 39 // void optionChanged(); 35 40 }; 36 41
Note: See TracChangeset
for help on using the changeset viewer.