Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5395 in orxonox.OLD for trunk/src/lib/gui


Ignore:
Timestamp:
Oct 17, 2005, 10:14:14 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: first element of the GLGui is visible… there is a long way to go…

Location:
trunk/src/lib/gui/gl_gui
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_button.cc

    r5363 r5395  
    1818#include "glgui_button.h"
    1919
     20#include "text.h"
     21
    2022using namespace std;
    2123
     
    3537GLGuiButton::~GLGuiButton()
    3638{
    37 
     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;
     42  */
    3843}
    3944
     
    4550  this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
    4651
     52  this->label = new Text();
     53  this->label->setParent2D(this);
    4754}
     55
     56void GLGuiButton::setLabel(const char* label)
     57{
     58  this->label->setText(label);
     59}
     60
    4861
    4962/**
  • trunk/src/lib/gui/gl_gui/glgui_button.h

    r5371 r5395  
    3131
    3232 public:
    33   GLGuiButton();
    34   virtual ~GLGuiButton();
     33   GLGuiButton();
     34   virtual ~GLGuiButton();
    3535
    36   void init();
     36   void init();
     37   void setLabel(const char* label);
    3738
    38   virtual void draw();
     39   virtual void draw();
    3940
    40  private:
     41  protected:
     42    Text*                label;
    4143
    42   char*                text;
    43   GLGui_ButtonState    state;
     44  private:
    4445
     46    GLGui_ButtonState    state;
    4547};
    4648
  • trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc

    r5366 r5395  
    1717
    1818#include "glgui_checkbutton.h"
     19
     20#include "text.h"
    1921
    2022using namespace std;
  • trunk/src/lib/gui/gl_gui/glgui_checkbutton.h

    r5391 r5395  
    2727  void    setActivity(bool bActive);
    2828
    29   virtual void draw();
     29  virtual void draw() const {};
     30  virtual void update() {};
    3031
    3132 private:
  • trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r5364 r5395  
    1717
    1818#include "glgui_pushbutton.h"
     19
     20#include "text.h"
    1921
    2022using namespace std;
     
    5052 * draws the GLGuiPushButton
    5153 */
    52 void GLGuiPushButton::draw()
     54void GLGuiPushButton::draw() const
     55{
     56  this->label->draw();
     57
     58}
     59
     60/**
     61 * updates the GLGuiPushButton
     62 */
     63void GLGuiPushButton::update()
    5364{
    5465
  • trunk/src/lib/gui/gl_gui/glgui_pushbutton.h

    r5364 r5395  
    2424  void init();
    2525
    26   virtual void draw();
    27 
     26  virtual void draw() const;
     27  virtual void update();
    2828 private:
    2929
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r5392 r5395  
    3434/**
    3535 * standard deconstructor
    36 */
     36 */
    3737GLGuiWidget::~GLGuiWidget()
    3838{
     
    9898}
    9999
     100
     101void GLGuiWidget::show()
     102{
     103  this->setVisibility(true);
     104}
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r5392 r5395  
    6161
    6262    virtual void update() = 0;
     63    virtual void draw() const = 0;
    6364
    6465  protected:
     
    6970    GLuint                frontModel;
    7071
     72  private:
    7173    Signal*               widgetSignals[GLGuiSignalCount];
    7274
    73   private:
    7475    bool                  focusable;        //!< If this widget can receive focus.
    7576    bool                  clickable;        //!< if this widget can be clicked upon.
Note: See TracChangeset for help on using the changeset viewer.