Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7997 in orxonox.OLD


Ignore:
Timestamp:
May 30, 2006, 11:34:38 PM (18 years ago)
Author:
bensch
Message:

gui: more Signals

Location:
branches/gui/src/lib/gui/gl_gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/gui/gl_gui/glgui_box.cc

    r7779 r7997  
    2323   * standard constructor
    2424  */
    25   GLGuiBox::GLGuiBox (BoxType type)
     25  GLGuiBox::GLGuiBox (OrxGui::Orientation orientation)
    2626  {
    2727    this->init();
    2828
    29     this->setType (type);
     29    this->setOrientation(orientation);
    3030  }
    3131
     
    4747  void GLGuiBox::pack(GLGuiWidget* widget)
    4848  {
    49     if (widget == NULL)
    50       return;
     49    assert (widget != NULL);
    5150
    5251    this->children.push_back(widget);
     
    5655  void GLGuiBox::unpack(GLGuiWidget* widget)
    5756  {
    58     if (widget == NULL)
    59     {
    60       this->children.clear();
    61     }
    62     else
    63     {
    64       this->children.remove(widget);
    65     }
     57    assert(widget == NULL);
     58
     59    this->children.remove(widget);
    6660  }
    6761
  • branches/gui/src/lib/gui/gl_gui/glgui_box.h

    r7779 r7997  
    99
    1010#include "glgui_container.h"
    11 
     11#include "glgui_defs.h"
    1212
    1313namespace OrxGui
    1414{
    15   typedef enum
    16   {
    17     Box_H,
    18     Box_V,
    19   } BoxType;
    20 
    2115  //! This is BOX part of the openglGUI class
    2216  /**
     
    2721
    2822  public:
    29     GLGuiBox(BoxType type = Box_H);
     23    GLGuiBox(OrxGui::Orientation orientation = OrxGui::Horizontal);
    3024    virtual ~GLGuiBox();
    3125
    3226    void init();
    33     void setType(BoxType type) { this->type = type; };
     27    /** @returns the Orientation of the Box */
     28    OrxGui::Orientation orientation() const { return this->_orientation; };
     29    void setOrientation(OrxGui::Orientation orientation) { this->_orientation = orientation; };
    3430
    3531    virtual void pack(GLGuiWidget* widget);
     
    4137
    4238  private:
    43     BoxType                  type;
     39    virtual void resize();
     40
     41    Orientation              _orientation;
    4442    std::list<GLGuiWidget*>  children;
    4543  };
  • branches/gui/src/lib/gui/gl_gui/glgui_checkbutton.cc

    r7985 r7997  
    5252  }
    5353
     54  void GLGuiCheckButton::setActivity(bool bActive)
     55  {
     56    this->bActive = bActive;
     57    emit(this->toggled(this->bActive));
     58  }
    5459
    5560  void GLGuiCheckButton::toggleActiveState()
    5661  {
    57     this->bActive = !this->bActive;
     62    this->setActivity(!this->isActive());
    5863  }
    5964
     
    7075  void GLGuiCheckButton::releasing(const Vector2D& pos)
    7176  {
    72     printf("%s released\n", this->getLabel().c_str());
    7377    GLGuiButton::releasing(pos);
    7478    this->toggleActiveState();
  • branches/gui/src/lib/gui/gl_gui/glgui_checkbutton.h

    r7985 r7997  
    3434    virtual void update() {};
    3535
     36    DeclareSignal1(toggled, bool);
     37
    3638  protected:
    3739    virtual void resize();
Note: See TracChangeset for help on using the changeset viewer.