Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7637 in orxonox.OLD for branches/qt_gui/src


Ignore:
Timestamp:
May 17, 2006, 11:10:02 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: keys added

Location:
branches/qt_gui/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/event/key_mapper.h

    r7635 r7637  
    2020  typedef struct KeyMapping
    2121  {
    22     int* pValue;
     22    int*              pValue;
    2323    const std::string pName;
    2424  };
     
    3232  void loadKeyBindings(IniParser* iniParser);
    3333
    34   static const KeyMapping* const getKeyMapping() { return KeyMapper::map; };
     34  static const KeyMapping* getKeyMapping() { return KeyMapper::map; };
    3535
    3636  void debug();
  • branches/qt_gui/src/lib/gui/qt_gui/gui_control.cc

    r7636 r7637  
    4646
    4747    {
    48       QLabel* keyLabel = new QLabel;
     48      //QLabel* keyLabel = new QLabel;
    4949
     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);
    5056
     57        GuiControlInput* input = new GuiControlInput(map->pName, this, "test");
     58        layout->addWidget(input, i, 1);
    5159
     60        ++map;
     61        ++i;
     62      }
    5263
    5364    }
     
    6475  }
    6576
     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
    6694}
  • branches/qt_gui/src/lib/gui/qt_gui/gui_control.h

    r7636 r7637  
    1010#include <string>
    1111#include <QtGui/QGroupBox>
     12#include <QtGui/QPushButton>
    1213#include "../gui_saveable.h"
    1314
     
    2425  };
    2526
    26   class GuiControlInput : public QGroupBox, public OrxGui::Saveable
     27  class GuiControlInput : public QPushButton, public OrxGui::Saveable
    2728  {
    2829    Q_OBJECT
     30  public:
    2931    GuiControlInput(const std::string& name, SaveableGroup* group, const std::string& defaultValue);
    3032
    31     public slots:
     33    virtual void load();
     34    virtual void save();
    3235
    33     signals:
    34       void optionChanged();
     36  public slots:
     37
     38  signals:
     39    //    void optionChanged();
    3540  };
    3641
Note: See TracChangeset for help on using the changeset viewer.