Changeset 7779 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_button.cc
- Timestamp:
- May 23, 2006, 10:04:17 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl_gui/glgui_button.cc
r7221 r7779 20 20 #include "text.h" 21 21 22 using namespace std;23 22 24 /** 25 * standard constructor 26 */ 27 GLGuiButton::GLGuiButton () 23 namespace OrxGui 28 24 { 29 this->init(); 25 /** 26 * standard constructor 27 */ 28 GLGuiButton::GLGuiButton () 29 { 30 this->init(); 30 31 31 }32 } 32 33 33 34 34 /** 35 * standard deconstructor 36 */ 37 GLGuiButton::~GLGuiButton() 38 { 39 /* this does not have to be done, since the Label is a child, 40 * and will be deleted by Element2D's deletion Process 41 * delete this->label; 35 /** 36 * standard deconstructor 42 37 */ 43 } 38 GLGuiButton::~GLGuiButton() 39 { 40 /* this does not have to be done, since the Label is a child, 41 * and will be deleted by Element2D's deletion Process 42 * delete this->label; 43 */ 44 } 44 45 45 /**46 * initializes the GUI-element47 */48 void GLGuiButton::init()49 {50 this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");46 /** 47 * initializes the GUI-element 48 */ 49 void GLGuiButton::init() 50 { 51 this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton"); 51 52 52 this->label = new Text();53 this->label->setParent2D(this);54 }53 this->label = new Text(); 54 this->label->setParent2D(this); 55 } 55 56 56 void GLGuiButton::setLabel(const std::string& label)57 {58 this->label->setText(label);59 this->label->setRelCoor2D(5, 5);60 this->setSize2D(this->label->getSizeX2D()+10, this->label->getSizeY2D()+10);61 }57 void GLGuiButton::setLabel(const std::string& label) 58 { 59 this->label->setText(label); 60 this->label->setRelCoor2D(5, 5); 61 this->setSize2D(this->label->getSizeX2D()+10, this->label->getSizeY2D()+10); 62 } 62 63 63 64 64 /** 65 * draws the GLGuiButton 66 */ 67 void GLGuiButton::draw() const 68 { 69 GLGuiWidget::draw(); 65 /** 66 * draws the GLGuiButton 67 */ 68 void GLGuiButton::draw() const 69 { 70 GLGuiWidget::draw(); 71 } 70 72 }
Note: See TracChangeset
for help on using the changeset viewer.