Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gl_gui/glgui_container.cc @ 5387

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

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

File size: 1.6 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_container.h"
19
20#include "list.h"
21
22
23using namespace std;
24
25/**
26 * standard constructor
27*/
28GLGuiContainer::GLGuiContainer ()
29{
30  this->init();
31  this->children = new tList<GLGuiWidget>;
32}
33
34
35/**
36 * standard deconstructor
37*/
38GLGuiContainer::~GLGuiContainer()
39{
40  delete this->children;
41}
42
43/**
44 * initializes the GUI-element
45 */
46void GLGuiContainer::init()
47{
48  this->setClassID(CL_GLGUI_CONTAINER, "GLGuiContainer");
49
50}
51
52void GLGuiContainer::showAll()
53{
54  tIterator<GLGuiWidget>* itC = this->children->getIterator();
55  GLGuiWidget* enumC = itC->firstElement();
56  while (enumC != NULL)
57  {
58    if (enumC->isA(CL_GLGUI_CONTAINER))
59      static_cast<GLGuiContainer*>(enumC)->showAll();
60    else
61      enumC->show();
62    enumC = itC->nextElement();
63  }
64  delete itC;
65
66  this->show();
67
68}
69
70void GLGuiContainer::hideAll()
71{
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;
83
84  this->hide();
85}
86
87
88/**
89 * draws the GLGuiContainer
90 */
91void GLGuiContainer::draw()
92{
93
94}
Note: See TracBrowser for help on using the repository browser.