Changeset 5391 in orxonox.OLD for trunk/src/lib/gui/gl_gui
- Timestamp:
- Oct 16, 2005, 1:37:41 PM (19 years ago)
- Location:
- trunk/src/lib/gui/gl_gui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl_gui/glgui_box.cc
r5364 r5391 23 23 * standard constructor 24 24 */ 25 GLGuiBox::GLGuiBox ( )25 GLGuiBox::GLGuiBox (GLGuiBoxType type) 26 26 { 27 27 this->init(); 28 28 29 this->setType (type); 29 30 } 30 31 -
trunk/src/lib/gui/gl_gui/glgui_box.h
r5364 r5391 12 12 // FORWARD DECLARATION 13 13 14 typedef enum 15 { 16 GLGuiBox_H, 17 GLGuiBox_V, 18 } GLGuiBoxType; 19 14 20 //! This is BOX part of the openglGUI class 15 21 /** … … 19 25 20 26 public: 21 GLGuiBox( );27 GLGuiBox(GLGuiBoxType type = GLGuiBox_H); 22 28 virtual ~GLGuiBox(); 23 29 24 30 void init(); 31 void setType(GLGuiBoxType type) { this->type = type; }; 25 32 26 33 virtual void draw(); 27 34 28 35 private: 36 GLGuiBoxType type; 29 37 30 38 }; -
trunk/src/lib/gui/gl_gui/glgui_checkbutton.h
r5366 r5391 24 24 void init(); 25 25 26 bool isActive() { return this->bActive; }; 27 void setActivity(bool bActive); 28 26 29 virtual void draw(); 27 30 28 31 private: 32 bool bActive; 29 33 30 34 }; -
trunk/src/lib/gui/gl_gui/glgui_container.h
r5364 r5391 25 25 void init(); 26 26 27 void add(GLGuiWidget* widget); 28 29 void setBorderWidth(float borderwidth); 30 27 31 void hideAll(); 28 32 void showAll(); 33 29 34 30 35 virtual void draw(); -
trunk/src/lib/gui/gl_gui/glgui_handler.cc
r5388 r5391 46 46 void GLGuiHandler::activate() 47 47 { 48 // EventHandler::getInstance()->setState(ES_MENU);48 EventHandler::getInstance()->pushState(ES_MENU); 49 49 50 50 } … … 52 52 void GLGuiHandler::deactivate() 53 53 { 54 EventHandler::getInstance()->popState(); 54 55 55 56 } -
trunk/src/lib/gui/gl_gui/glgui_menu.h
r5366 r5391 11 11 12 12 // FORWARD DECLARATION 13 13 template<class T> class tList; 14 14 //! This is Menu part of the openglGUI class 15 15 /** … … 24 24 void init(); 25 25 26 void addItem(const char* itemName); 27 void removeItem(const char* itemName); 28 void removeItem(unsigned int itemNumber); 29 void selectItem(const char* itemName); 30 void selectItem(unsigned int itemNumber); 31 26 32 virtual void draw(); 27 33 28 34 private: 35 tList<char>* itemList; 29 36 30 37 }; -
trunk/src/lib/gui/gl_gui/glgui_widget.cc
r5387 r5391 39 39 40 40 41 bool GLGuiWidget::focusOverWidget(float x, float y) 42 { 43 if (this->getAbsCoor2D().x < x && this->getAbsCoor2D().x+ this->getSizeX2D() > x && 44 this->getAbsCoor2D().y < y && this->getAbsCoor2D().y+ this->getSizeX2D() > y) 45 return true; 46 else 47 return false; 48 } 49 50 41 51 /** 42 52 * initializes the GUI-element -
trunk/src/lib/gui/gl_gui/glgui_widget.h
r5387 r5391 1 1 /*! 2 * @file glgui_widget.h3 * The gl_widget of the openglGUI4 */2 * @file glgui_widget.h 3 * The gl_widget of the openglGUI 4 */ 5 5 6 6 #ifndef _GLGUI_WIDGET_H … … 9 9 #include "element_2d.h" 10 10 #include "glincl.h" 11 #include "event.h" 11 12 12 13 // FORWARD DECLARATION 13 14 class Material; 15 class Signal; //!< @todo create this!! 16 17 typedef enum 18 { 19 GLGuiSignal_click = 0, 20 GLGuiSignal_release = 1, 21 GLGuiSignal_rollOn = 2, 22 GLGuiSignal_rollOff = 3, 23 GLGuiSignal_open = 4, 24 GLGuiSignal_close = 5, 25 GLGuiSignal_destroy = 6, 26 27 GLGuiSignalCount = 7, 28 } GLGuiSignalType; 14 29 15 30 //! if the Element should be visible by default. … … 30 45 void hide(); 31 46 47 void connectSignal(GLGuiSignalType signalType, Signal* signal); 48 void disconnectSignal(GLGuiSignalType); 49 bool focusOverWidget(float x, float y); 50 51 // if something was clickt on the GUI-widget. 52 virtual void click(const Event& event) {}; 53 virtual void release(const Event& event) {}; 54 55 virtual void receiveFocus() {}; 56 virtual void removeFocus() {}; 32 57 33 58 virtual void update() = 0; … … 40 65 GLuint frontModel; 41 66 67 Signal* widgetSignals[GLGuiSignalCount]; 68 42 69 private: 43 70 bool focusable; //!< If this widget can receive focus.
Note: See TracChangeset
for help on using the changeset viewer.