Last change
on this file since 7218 was
7130,
checked in by bensch, 19 years ago
|
orxonox/trunk: removed some std::list
|
File size:
1.7 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 | |
---|
20 | using namespace std; |
---|
21 | |
---|
22 | /** |
---|
23 | * standard constructor |
---|
24 | */ |
---|
25 | GLGuiBox::GLGuiBox (GLGuiBoxType type) |
---|
26 | { |
---|
27 | this->init(); |
---|
28 | |
---|
29 | this->setType (type); |
---|
30 | } |
---|
31 | |
---|
32 | |
---|
33 | /** |
---|
34 | * standard deconstructor |
---|
35 | */ |
---|
36 | GLGuiBox::~GLGuiBox() |
---|
37 | { |
---|
38 | } |
---|
39 | |
---|
40 | /** |
---|
41 | * initializes the GUI-element |
---|
42 | */ |
---|
43 | void GLGuiBox::init() |
---|
44 | { |
---|
45 | this->setClassID(CL_GLGUI_BOX, "GLGuiBox"); |
---|
46 | } |
---|
47 | |
---|
48 | void GLGuiBox::pack(GLGuiWidget* widget) |
---|
49 | { |
---|
50 | if (widget == NULL) |
---|
51 | return; |
---|
52 | |
---|
53 | this->children.push_back(widget); |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | void GLGuiBox::unpack(GLGuiWidget* widget) |
---|
58 | { |
---|
59 | if (widget == NULL) |
---|
60 | { |
---|
61 | this->children.clear(); |
---|
62 | } |
---|
63 | else |
---|
64 | { |
---|
65 | this->children.remove(widget); |
---|
66 | } |
---|
67 | } |
---|
68 | |
---|
69 | void GLGuiBox::showAll() |
---|
70 | { |
---|
71 | std::list<GLGuiWidget*>::iterator itC = this->children.begin(); |
---|
72 | while (itC != this->children.end()) |
---|
73 | { |
---|
74 | if ((*itC)->isA(CL_GLGUI_CONTAINER)) |
---|
75 | static_cast<GLGuiContainer*>(*itC)->showAll(); |
---|
76 | else |
---|
77 | (*itC)->show(); |
---|
78 | itC++; |
---|
79 | } |
---|
80 | |
---|
81 | this->show(); |
---|
82 | |
---|
83 | } |
---|
84 | |
---|
85 | void GLGuiBox::hideAll() |
---|
86 | { |
---|
87 | std::list<GLGuiWidget*>::iterator itC = this->children.begin(); |
---|
88 | while (itC != this->children.end()) |
---|
89 | { |
---|
90 | if ((*itC)->isA(CL_GLGUI_CONTAINER)) |
---|
91 | static_cast<GLGuiContainer*>(*itC)->hideAll(); |
---|
92 | else |
---|
93 | (*itC)->hide(); |
---|
94 | itC++; |
---|
95 | } |
---|
96 | |
---|
97 | this->hide(); |
---|
98 | } |
---|
99 | |
---|
100 | |
---|
101 | /** |
---|
102 | * draws the GLGuiBox |
---|
103 | */ |
---|
104 | void GLGuiBox::draw() const |
---|
105 | { |
---|
106 | |
---|
107 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.