Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7478 in orxonox.OLD for branches/qt_gui/src/lib


Ignore:
Timestamp:
May 2, 2006, 9:34:48 PM (19 years ago)
Author:
bensch
Message:

qt_gui: gui-element

Location:
branches/qt_gui/src/lib/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/gui_element.cc

    r7476 r7478  
    2727   *  standard constructor
    2828   */
    29   GuiElement::GuiElement ()
     29  GuiElement::GuiElement (const std::string& name)
     30  : GuiSaveableGroup(name)
    3031  {
    31     this->mainWidget = NULL;
     32    //this->mainWidget = NULL;
    3233  }
    3334
  • branches/qt_gui/src/lib/gui/gui_element.h

    r7476 r7478  
    88#define _GUI_ELEMENT_H
    99
     10#include "gui_saveable.h"
     11
    1012namespace OrxGui
    1113{
     
    1315
    1416  //! A SuperClass for all the Different GuiElements
    15   class GuiElement
     17  class GuiElement : public GuiSaveableGroup
    1618  {
    1719
    1820  public:
    19     GuiElement();
     21    GuiElement(const std::string& name);
    2022    virtual ~GuiElement();
    2123
  • branches/qt_gui/src/lib/gui/gui_saveable.cc

    r7470 r7478  
    4949      : GuiSaveable(groupName)
    5050  {
    51 //    this->setName(groupName);
     51    //    this->setName(groupName);
    5252  }
    5353
  • branches/qt_gui/src/lib/gui/gui_saveable.h

    r7470 r7478  
    1212
    1313// FORWARD DECLARATION
    14   namespace OrxGui
     14namespace OrxGui
     15{
     16  //! A class for ...
     17  class GuiSaveable
    1518  {
    16     //! A class for ...
    17     class GuiSaveable
    18     {
    19     public:
    20     protected:
    21       GuiSaveable(const std::string& optionName);
    22       virtual ~GuiSaveable();
     19  public:
     20    virtual ~GuiSaveable();
    2321
    24       void makeSaveable();
     22    void makeSaveable();
    2523
    26       virtual void load(const MultiType& value) = 0;
    27       virtual const MultiType& save() = 0;
     24    virtual void load(const MultiType& value) = 0;
     25    virtual const MultiType& save() = 0;
    2826
    29       MultiType&       getValue() { return this->value; };
    30       const MultiType& getValue() const { return this->value; };
    31       bool             isSaveable() const { return this->bSaveable; };
     27    MultiType&       getValue() { return this->value; };
     28    const MultiType& getValue() const { return this->value; };
     29    bool             isSaveable() const { return this->bSaveable; };
    3230
    33     protected:
    34       virtual void makingElementSaveable() {};
     31  protected:
     32    GuiSaveable(const std::string& optionName);
     33    virtual void makingElementSaveable() {};
    3534
    36     private:
    37       MultiType       value;
    38       bool            bSaveable;
    39     };
     35  private:
     36    MultiType       value;
     37    bool            bSaveable;
     38  };
    4039
    4140
    4241
    43     class GuiSaveableGroup : virtual public GuiSaveable
    44     {
    45     public:
    46       GuiSaveableGroup(const std::string& name);
    47       ~GuiSaveableGroup();
     42  class GuiSaveableGroup : public GuiSaveable
     43  {
     44  public:
     45    virtual ~GuiSaveableGroup();
    4846
    49       void addSaveable(GuiSaveable* saveable);
    50       void removeSaveable(GuiSaveable* saveable);
     47    void addSaveable(GuiSaveable* saveable);
     48    void removeSaveable(GuiSaveable* saveable);
    5149
    52     protected:
    53       virtual void makingElementSaveable();
    54     private:
    55       std::vector<GuiSaveable*>              saveables;
    56       static std::vector<GuiSaveableGroup*>  saveableGroups;
    57     };
     50  protected:
     51    GuiSaveableGroup(const std::string& name);
     52    virtual void makingElementSaveable();
    5853
    59   }
     54  private:
     55    std::vector<GuiSaveable*>              saveables;
     56    static std::vector<GuiSaveableGroup*>  saveableGroups;
     57  };
     58
     59}
    6060#endif /* _GUI_SAVEABLE_H */
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc

    r7473 r7478  
    1818#include "qt_gui.h"
    1919
     20#include <qapplication.h>
     21
     22
    2023namespace OrxGui
    2124{
    22   QtGui::QtGui()
     25  QtGui::QtGui(int argc, char** argv)
     26  : QApplication(argc, argv)
    2327  {
    2428
     
    2630
    2731  }
     32
    2833  QtGui::~QtGui()
    2934  {
     
    4247    //! Update the Gui.
    4348  void QtGui::update()
    44   {}
     49  {
     50    this->processEvents();
     51  }
    4552
    4653}
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui.h

    r7473 r7478  
    99#include "../gui.h"
    1010#include "gui_element.h"
     11#include <qapplication.h>
     12
    1113namespace OrxGui
    1214{
    13   class QtGui : public OrxGui::Gui
     15  class QtGui : public OrxGui::Gui, QApplication
    1416  {
    1517    public:
    16       QtGui();
     18      QtGui(int argc, char** argv);
    1719      virtual ~QtGui();
    1820
Note: See TracChangeset for help on using the changeset viewer.