Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/gui/src/lib/gui/gl_gui/glgui_box.cc @ 8002

Last change on this file since 8002 was 8002, checked in by bensch, 19 years ago

gui: multiple Connections also work

File size: 1.8 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
17
18#include "glgui_box.h"
19
20namespace OrxGui
21{
22  /**
23   * standard constructor
24  */
25  GLGuiBox::GLGuiBox (OrxGui::Orientation orientation)
26  {
27    this->init();
28
29    this->setOrientation(orientation);
30  }
31
32
33  /**
34   * standard deconstructor
35  */
36  GLGuiBox::~GLGuiBox()
37  {}
38
39  /**
40   * initializes the GUI-element
41   */
42  void GLGuiBox::init()
43  {
44    this->setClassID(CL_GLGUI_BOX, "GLGuiBox");
45  }
46
47  void GLGuiBox::pack(GLGuiWidget* widget)
48  {
49    assert (widget != NULL);
50
51    this->children.push_back(widget);
52  }
53
54
55  void GLGuiBox::unpack(GLGuiWidget* widget)
56  {
57    assert(widget == NULL);
58
59    this->children.remove(widget);
60  }
61
62  void GLGuiBox::showAll()
63  {
64    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
65    while (itC != this->children.end())
66    {
67      if ((*itC)->isA(CL_GLGUI_CONTAINER))
68        static_cast<GLGuiContainer*>(*itC)->showAll();
69      else
70        (*itC)->show();
71      itC++;
72    }
73
74    this->show();
75  }
76
77  void GLGuiBox::hideAll()
78  {
79    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
80    while (itC != this->children.end())
81    {
82      if ((*itC)->isA(CL_GLGUI_CONTAINER))
83        static_cast<GLGuiContainer*>(*itC)->hideAll();
84      else
85        (*itC)->hide();
86      itC++;
87    }
88
89    this->hide();
90  }
91
92
93  /**
94   * draws the GLGuiBox
95   */
96  void GLGuiBox::draw() const
97  {
98  }
99}
Note: See TracBrowser for help on using the repository browser.