Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5387 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Oct 16, 2005, 12:42:16 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: PNode and Element2D can now return their children-lists as const tList<type>*

Location:
trunk/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.h

    r5383 r5387  
    104104  void setParent (const char* parentName);
    105105  /** @returns the parent of this PNode */
    106   PNode* getParent () const { return this->parent; };
     106  inline PNode* getParent () const { return this->parent; };
     107  /** @returns the List of Children of this PNode */
     108  inline const tList<PNode>* getChildren() const { return this->children; };
    107109
    108110  void setParentSoft(PNode* parentNode, float bias = 1.0);
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5382 r5387  
    153153    void setParent2D (const char* parentName);
    154154    /** @returns the parent of this Element2D */
    155     Element2D* getParent () const { return this->parent; };
     155    inline Element2D* getParent () const { return this->parent; };
     156    /** @returns the List of Children of this Element2D */
     157    inline const tList<Element2D>* getChildren2D() const { return this->children; };
    156158
    157159    void setParentSoft2D(Element2D* parentNode, float bias = 1.0);
  • trunk/src/lib/gui/gl_gui/glgui_container.cc

    r5364 r5387  
    5252void GLGuiContainer::showAll()
    5353{
    54 
    5554  tIterator<GLGuiWidget>* itC = this->children->getIterator();
    5655  GLGuiWidget* enumC = itC->firstElement();
     
    6059      static_cast<GLGuiContainer*>(enumC)->showAll();
    6160    else
    62      enumC->show();
     61      enumC->show();
    6362    enumC = itC->nextElement();
    6463  }
     
    7170void GLGuiContainer::hideAll()
    7271{
     72  tIterator<GLGuiWidget>* itC = this->children->getIterator();
     73  GLGuiWidget* enumC = itC->firstElement();
     74  while (enumC != NULL)
     75  {
     76    if (enumC->isA(CL_GLGUI_CONTAINER))
     77      static_cast<GLGuiContainer*>(enumC)->showAll();
     78    else
     79      enumC->hide();
     80    enumC = itC->nextElement();
     81  }
     82  delete itC;
    7383
     84  this->hide();
    7485}
    7586
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r5384 r5387  
    2626{
    2727  this->init();
    28   this->setVisibility(true);
     28  this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
    2929}
    3030
     
    4646  this->setClassID(CL_GLGUI_WIDGET, "GLGuiWidget");
    4747
    48   this->managed = false;
    4948  this->focusable = true;
    5049  this->clickable = true;
    5150
    52   this->backGround = NULL;
    53   this->renderModel = 0;
     51  this->backMat = NULL;
     52  this->backModel = 0;
     53  this->frontMat = NULL;
     54  this->frontModel = 0;
    5455}
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r5384 r5387  
    1313class Material;
    1414
     15//! if the Element should be visible by default.
     16#define GLGUI_WIDGET_DEFAULT_VISIBLE       false
     17
    1518//! This is widget part of the openglGUI class
    1619/**
    17 * A widget is the main class of all the elements of th GUI.
    18 */
     20 * A widget is the main class of all the elements of th GUI.
     21 */
    1922class GLGuiWidget : public Element2D {
    2023  public:
     
    3134
    3235  protected:
    33     Material*             backGround;
    34     GLuint                renderModel;
     36    Material*             backMat;
     37    GLuint                backModel;
     38
     39    Material*             frontMat;
     40    GLuint                frontModel;
    3541
    3642  private:
    37     bool                  managed;          //!< if this GUI-element should be managed. true means it gets deleted with the deletion of it's parent.
    38     bool                  focusable;        //!< If it can receive focus.
    39     bool                  clickable;        //!< if it can be clicked upon.
     43    bool                  focusable;        //!< If this widget can receive focus.
     44    bool                  clickable;        //!< if this widget can be clicked upon.
    4045};
    4146
Note: See TracChangeset for help on using the changeset viewer.