Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5393 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_frame.cc


Ignore:
Timestamp:
Oct 16, 2005, 2:28:55 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: container-packing

File:
1 edited

Legend:

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

    r5364 r5393  
    1717
    1818#include "glgui_frame.h"
     19
     20#include "debug.h"
    1921
    2022using namespace std;
     
    4446{
    4547  this->setClassID(CL_GLGUI_FRAME, "GLGuiFrame");
     48  this->child = NULL;
     49}
    4650
     51void GLGuiFrame::pack(GLGuiWidget* widget)
     52{
     53  if (widget == NULL)
     54    return;
     55
     56  if (this->child == NULL)
     57    this->child = widget;
     58  else
     59  {
     60    PRINTF(2)("Frame %s is already filled, not filling with %s\n", this->getName(), widget->getName());
     61  }
    4762}
     63
     64void GLGuiFrame::unpack(GLGuiWidget* widget)
     65{
     66  if (widget == NULL || widget == this->child)
     67    this->child = NULL;
     68}
     69
     70void GLGuiFrame::showAll()
     71{
     72  if (this->child != NULL)
     73  {
     74    if (this->child->isA(CL_GLGUI_CONTAINER))
     75      static_cast<GLGuiContainer*>(this->child)->showAll();
     76    else
     77      this->child->show();
     78  }
     79  this->show();
     80}
     81
     82void GLGuiFrame::hideAll()
     83{
     84  if (this->child != NULL)
     85  {
     86    if (this->child->isA(CL_GLGUI_CONTAINER))
     87      static_cast<GLGuiContainer*>(this->child)->hideAll();
     88    else
     89      this->child->hide();
     90  }
     91  this->hide();
     92}
     93
    4894
    4995/**
Note: See TracChangeset for help on using the changeset viewer.