Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/water/src/lib/gui/gl_gui/glgui_button.cc @ 7822

Last change on this file since 7822 was 7779, checked in by bensch, 19 years ago

3088 linews changed :): trunk: namespaces

File size: 1.3 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
17
18#include "glgui_button.h"
19
20#include "text.h"
21
22
23namespace OrxGui
24{
25  /**
26   * standard constructor
27  */
28  GLGuiButton::GLGuiButton ()
29  {
30    this->init();
31
32  }
33
34
35  /**
36   * standard deconstructor
37  */
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  }
45
46  /**
47   * initializes the GUI-element
48   */
49  void GLGuiButton::init()
50  {
51    this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
52
53    this->label = new Text();
54    this->label->setParent2D(this);
55  }
56
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  }
63
64
65  /**
66   * draws the GLGuiButton
67   */
68  void GLGuiButton::draw() const
69  {
70    GLGuiWidget::draw();
71  }
72}
Note: See TracBrowser for help on using the repository browser.