Changeset 7873 in orxonox.OLD for branches/gui/src
- Timestamp:
- May 26, 2006, 2:40:44 PM (19 years ago)
- Location:
- branches/gui/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/defs/class_id.h
r7836 r7873 331 331 CL_GLMENU_IMAGE_SCREEN = 0x00000b20, 332 332 CL_GLGUI_BAR = 0x00000b30, 333 CL_GLGUI_CURSOR = 0x00000b50, 333 334 334 335 // QT_GUI -
branches/gui/src/lib/graphics/text_engine/text.cc
r7753 r7873 36 36 this->font = NULL; 37 37 this->size = textSize; 38 this->setSizeY2D(size); 38 39 this->blending = TEXT_DEFAULT_BLENDING; 39 40 this->color = TEXT_DEFAULT_COLOR; -
branches/gui/src/lib/gui/gl_gui/Makefile.am
r7855 r7873 9 9 10 10 11 libORXglgui_a_SOURCES = glmenu/glmenu_imagescreen.cc \ 12 glgui_handler.cc \ 13 signal_connector.cc \ 14 glgui_mainwidget.cc \ 15 glgui_widget.cc \ 16 glgui_button.cc \ 17 glgui_pushbutton.cc \ 18 glgui_container.cc \ 19 glgui_bar.cc \ 20 glgui_box.cc \ 21 glgui_frame.cc \ 22 glgui_window.cc 11 libORXglgui_a_SOURCES = \ 12 glmenu/glmenu_imagescreen.cc \ 13 glgui_handler.cc \ 14 signal_connector.cc \ 15 glgui_mainwidget.cc \ 16 glgui_widget.cc \ 17 glgui_button.cc \ 18 glgui_pushbutton.cc \ 19 glgui_container.cc \ 20 glgui_bar.cc \ 21 glgui_box.cc \ 22 glgui_frame.cc \ 23 glgui_window.cc \ 24 glgui_cursor.cc 23 25 24 26 25 noinst_HEADERS= glmenu/glmenu_imagescreen.h \ 27 noinst_HEADERS= \ 28 glmenu/glmenu_imagescreen.h \ 26 29 signal_connector.h \ 27 30 glgui.h \ … … 35 38 glgui_box.h \ 36 39 glgui_frame.h \ 37 glgui_window.h 40 glgui_window.h \ 41 glgui_cursor.h 38 42 39 43 -
branches/gui/src/lib/gui/gl_gui/glgui.h
r7855 r7873 13 13 #include "glgui_checkbutton.h" 14 14 #include "glgui_colorselector.h" 15 #include "glgui_pushbutton.h" 15 16 16 17 namespace OrxGui … … 24 25 25 26 26 #endif _GLGUI_H27 #endif /* _GLGUI_H */ -
branches/gui/src/lib/gui/gl_gui/glgui_button.cc
r7779 r7873 26 26 * standard constructor 27 27 */ 28 GLGuiButton::GLGuiButton ( )28 GLGuiButton::GLGuiButton (const std::string& label) 29 29 { 30 30 this->init(); 31 this->setLabel(label); 31 32 33 this->label.setText("TEST"); 32 34 } 33 35 … … 45 47 46 48 /** 47 * initializes the GUI-element49 * @brief initializes the GUI-element 48 50 */ 49 51 void GLGuiButton::init() … … 51 53 this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton"); 52 54 53 this->label = new Text(); 54 this->label->setParent2D(this); 55 this->label.setParent2D(this); 55 56 } 56 57 57 58 void GLGuiButton::setLabel(const std::string& label) 58 59 { 59 this->label ->setText(label);60 this->label ->setRelCoor2D(5, 5);61 this->setSize2D(this->label ->getSizeX2D()+10, this->label->getSizeY2D()+10);60 this->label.setText(label); 61 this->label.setRelCoor2D(5, 5); 62 this->setSize2D(this->label.getSizeX2D(), this->label.getSizeY2D()+10); 62 63 } 63 64 -
branches/gui/src/lib/gui/gl_gui/glgui_button.h
r7779 r7873 10 10 #include "glgui_widget.h" 11 11 12 class Text; 12 #include "text.h" 13 13 14 14 namespace OrxGui … … 33 33 34 34 public: 35 GLGuiButton( );35 GLGuiButton(const std::string& label); 36 36 virtual ~GLGuiButton(); 37 37 38 void init();39 38 void setLabel(const std::string& label); 40 39 41 40 virtual void draw() const; 42 41 42 private: 43 void init(); 44 45 43 46 protected: 44 Text* label; 47 48 Text label; 45 49 46 50 private: -
branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
r7779 r7873 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI 17 17 18 #include "glgui_ .h"18 #include "glgui_cursor.h" 19 19 20 20 namespace OrxGui … … 24 24 * standard constructor 25 25 */ 26 GLGui ::GLGui()26 GLGuiCursor::GLGuiCursor () 27 27 { 28 28 this->init(); … … 34 34 * standard deconstructor 35 35 */ 36 GLGui ::~GLGui()36 GLGuiCursor::~GLGuiCursor() 37 37 { 38 38 } … … 41 41 * initializes the GUI-element 42 42 */ 43 GLGui::init()43 void GLGuiCursor::init() 44 44 { 45 this->setClassID(CL_GLGUI_ , "GLGui");45 this->setClassID(CL_GLGUI_CURSOR, "GLGuiCursor"); 46 46 47 47 } 48 48 49 49 /** 50 * draws the GLGui 50 * draws the GLGuiCursor 51 51 */ 52 void GLGui ::draw()52 void GLGuiCursor::draw() 53 53 { 54 54 } -
branches/gui/src/lib/gui/gl_gui/glgui_cursor.h
r7779 r7873 1 1 /*! 2 * @file glgui_ .h3 * The gl_ widget of th openglGUI2 * @file glgui_cursor.h 3 * The gl_cursor widget of th openglGUI 4 4 * 5 5 */ 6 6 7 #ifndef _GLGUI_ _H8 #define _GLGUI_ _H7 #ifndef _GLGUI_CURSOR_H 8 #define _GLGUI_CURSOR_H 9 9 10 #include "base_object.h" 10 #include "glgui_widget.h" 11 #include "event_listener.h" 11 12 12 13 namespace OrxGui … … 18 19 * 19 20 */ 20 class GLGui : public GLGui21 class GLGuiCursor : public GLGuiWidget, public EventListener 21 22 { 22 23 23 24 public: 24 GLGui ();25 virtual ~GLGui ();25 GLGuiCursor(); 26 virtual ~GLGuiCursor(); 26 27 27 28 void init(); … … 33 34 }; 34 35 } 35 #endif /* _GLGUI_ _H */36 #endif /* _GLGUI_CURSOR_H */ -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.cc
r7779 r7873 25 25 26 26 /** 27 * standard constructor 28 */ 29 GLGuiPushButton::GLGuiPushButton () 27 * @brief standard constructor 28 */ 29 GLGuiPushButton::GLGuiPushButton (const std::string& label) 30 :GLGuiButton(label) 30 31 { 31 32 this->init(); … … 34 35 35 36 /** 36 * standard deconstructor37 * @brief standard deconstructor 37 38 */ 38 39 GLGuiPushButton::~GLGuiPushButton() … … 47 48 this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton"); 48 49 this->frontMat.setDiffuse(1,0,0); 49 // this->label->setRelCoor2D(10, 10);50 50 } 51 51 … … 56 56 { 57 57 this->startDraw(); 58 59 // GLGuiButton::draw(); 58 GLGuiButton::draw(); 60 59 61 60 this->frontMat.select(); 62 61 glBegin(GL_QUADS); 63 62 64 glVertex2d( 0,0);65 glVertex2d( 0, this->getSizeY2D());66 glVertex2d(this->getSizeX2D() , this->getSizeY2D());67 glVertex2d(this->getSizeX2D() ,0);63 glVertex2d(1, 1); 64 glVertex2d(1, this->getSizeY2D() -1); 65 glVertex2d(this->getSizeX2D() -1, this->getSizeY2D()-1); 66 glVertex2d(this->getSizeX2D()-1,1); 68 67 69 68 glEnd(); -
branches/gui/src/lib/gui/gl_gui/glgui_pushbutton.h
r7779 r7873 23 23 24 24 public: 25 GLGuiPushButton( );25 GLGuiPushButton(const std::string& label); 26 26 virtual ~GLGuiPushButton(); 27 27 28 void init();29 28 30 29 virtual void draw() const; 31 30 virtual void update(); 32 31 private: 32 void init(); 33 33 34 34 }; -
branches/gui/src/story_entities/simple_game_menu.cc
r7868 r7873 28 28 #include "util/loading/factory.h" 29 29 30 #include "p_node.h"31 30 #include "world_entity.h" 32 31 #include "elements/image_entity.h" … … 41 40 #include "cd_engine.h" 42 41 43 44 using namespace std; 45 42 #include "glgui.h" 46 43 47 44 //! This creates a Factory to fabricate a SimpleGameMenu … … 65 62 this->menuSelectedIndex = 0; 66 63 this->selectorSource = NULL; 64 65 OrxGui::GLGuiPushButton* pb = new OrxGui::GLGuiPushButton("PUSH ME"); 66 pb->show(); 67 pb->setAbsCoor2D(50, 50); 67 68 68 69 if (root != NULL)
Note: See TracChangeset
for help on using the changeset viewer.