Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8974 in orxonox.OLD for trunk/src/world_entities/elements


Ignore:
Timestamp:
Jul 1, 2006, 11:47:08 AM (18 years ago)
Author:
bensch
Message:

trunk: better implemented

Location:
trunk/src/world_entities/elements
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/elements/glgui_energywidget.cc

    r8973 r8974  
    2828    //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
    2929
    30     this->text.setParent2D(this);
    31     this->bar.setParent2D(this);
     30    this->pack(&this->text);
     31    this->pack(&this->bar);
    3232  }
    3333
     
    4040    // delete what has to be deleted here
    4141  }
     42
     43
     44  void GLGuiEnergyWidget::setMaximum(float max)
     45  {
     46    this->bar.setMaximum(max);
     47  }
     48
     49  void GLGuiEnergyWidget::setValue(float value)
     50  {
     51    MultiType val = value;
     52
     53    this->bar.setValue(value);
     54    this->text.setText(val.getString());
     55  }
     56
     57
     58
    4259}
  • trunk/src/world_entities/elements/glgui_energywidget.h

    r8973 r8974  
    77#define _GLGUI_ENERGY_WIDGET_H
    88
    9 #include "glgui_widget.h"
     9#include "glgui_box.h"
    1010#include "glgui_bar.h"
    1111#include "glgui_text.h"
     
    1515
    1616  //! A class for ...
    17   class GLGuiEnergyWidget : public GLGuiWidget
     17  class GLGuiEnergyWidget : public GLGuiBox
    1818  {
    1919
     
    2222    virtual ~GLGuiEnergyWidget();
    2323
     24    void setMaximum(float max);
     25    void setValue(float value);
     26
    2427  protected:
    25     virtual void resize();
     28    //virtual void resize();
    2629
    2730  private:
Note: See TracChangeset for help on using the changeset viewer.