Changeset 7478 in orxonox.OLD for branches/qt_gui
- Timestamp:
- May 2, 2006, 9:34:48 PM (19 years ago)
- 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 27 27 * standard constructor 28 28 */ 29 GuiElement::GuiElement () 29 GuiElement::GuiElement (const std::string& name) 30 : GuiSaveableGroup(name) 30 31 { 31 this->mainWidget = NULL;32 //this->mainWidget = NULL; 32 33 } 33 34 -
branches/qt_gui/src/lib/gui/gui_element.h
r7476 r7478 8 8 #define _GUI_ELEMENT_H 9 9 10 #include "gui_saveable.h" 11 10 12 namespace OrxGui 11 13 { … … 13 15 14 16 //! A SuperClass for all the Different GuiElements 15 class GuiElement 17 class GuiElement : public GuiSaveableGroup 16 18 { 17 19 18 20 public: 19 GuiElement( );21 GuiElement(const std::string& name); 20 22 virtual ~GuiElement(); 21 23 -
branches/qt_gui/src/lib/gui/gui_saveable.cc
r7470 r7478 49 49 : GuiSaveable(groupName) 50 50 { 51 // this->setName(groupName);51 // this->setName(groupName); 52 52 } 53 53 -
branches/qt_gui/src/lib/gui/gui_saveable.h
r7470 r7478 12 12 13 13 // FORWARD DECLARATION 14 namespace OrxGui 14 namespace OrxGui 15 { 16 //! A class for ... 17 class GuiSaveable 15 18 { 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(); 23 21 24 22 void makeSaveable(); 25 23 26 27 24 virtual void load(const MultiType& value) = 0; 25 virtual const MultiType& save() = 0; 28 26 29 30 31 27 MultiType& getValue() { return this->value; }; 28 const MultiType& getValue() const { return this->value; }; 29 bool isSaveable() const { return this->bSaveable; }; 32 30 33 protected: 34 virtual void makingElementSaveable() {}; 31 protected: 32 GuiSaveable(const std::string& optionName); 33 virtual void makingElementSaveable() {}; 35 34 36 37 38 39 35 private: 36 MultiType value; 37 bool bSaveable; 38 }; 40 39 41 40 42 41 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(); 48 46 49 50 47 void addSaveable(GuiSaveable* saveable); 48 void removeSaveable(GuiSaveable* saveable); 51 49 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(); 58 53 59 } 54 private: 55 std::vector<GuiSaveable*> saveables; 56 static std::vector<GuiSaveableGroup*> saveableGroups; 57 }; 58 59 } 60 60 #endif /* _GUI_SAVEABLE_H */ -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc
r7473 r7478 18 18 #include "qt_gui.h" 19 19 20 #include <qapplication.h> 21 22 20 23 namespace OrxGui 21 24 { 22 QtGui::QtGui() 25 QtGui::QtGui(int argc, char** argv) 26 : QApplication(argc, argv) 23 27 { 24 28 … … 26 30 27 31 } 32 28 33 QtGui::~QtGui() 29 34 { … … 42 47 //! Update the Gui. 43 48 void QtGui::update() 44 {} 49 { 50 this->processEvents(); 51 } 45 52 46 53 } -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui.h
r7473 r7478 9 9 #include "../gui.h" 10 10 #include "gui_element.h" 11 #include <qapplication.h> 12 11 13 namespace OrxGui 12 14 { 13 class QtGui : public OrxGui::Gui 15 class QtGui : public OrxGui::Gui, QApplication 14 16 { 15 17 public: 16 QtGui( );18 QtGui(int argc, char** argv); 17 19 virtual ~QtGui(); 18 20
Note: See TracChangeset
for help on using the changeset viewer.