Last change
on this file since 7981 was
7779,
checked in by bensch, 19 years ago
|
3088 linews changed : trunk: namespaces
|
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 | |
---|
20 | namespace OrxGui |
---|
21 | { |
---|
22 | /** |
---|
23 | * standard constructor |
---|
24 | */ |
---|
25 | GLGuiBox::GLGuiBox (BoxType 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 | * 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 | if (widget == NULL) |
---|
50 | return; |
---|
51 | |
---|
52 | this->children.push_back(widget); |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | void GLGuiBox::unpack(GLGuiWidget* widget) |
---|
57 | { |
---|
58 | if (widget == NULL) |
---|
59 | { |
---|
60 | this->children.clear(); |
---|
61 | } |
---|
62 | else |
---|
63 | { |
---|
64 | this->children.remove(widget); |
---|
65 | } |
---|
66 | } |
---|
67 | |
---|
68 | void GLGuiBox::showAll() |
---|
69 | { |
---|
70 | std::list<GLGuiWidget*>::iterator itC = this->children.begin(); |
---|
71 | while (itC != this->children.end()) |
---|
72 | { |
---|
73 | if ((*itC)->isA(CL_GLGUI_CONTAINER)) |
---|
74 | static_cast<GLGuiContainer*>(*itC)->showAll(); |
---|
75 | else |
---|
76 | (*itC)->show(); |
---|
77 | itC++; |
---|
78 | } |
---|
79 | |
---|
80 | this->show(); |
---|
81 | |
---|
82 | } |
---|
83 | |
---|
84 | void GLGuiBox::hideAll() |
---|
85 | { |
---|
86 | std::list<GLGuiWidget*>::iterator itC = this->children.begin(); |
---|
87 | while (itC != this->children.end()) |
---|
88 | { |
---|
89 | if ((*itC)->isA(CL_GLGUI_CONTAINER)) |
---|
90 | static_cast<GLGuiContainer*>(*itC)->hideAll(); |
---|
91 | else |
---|
92 | (*itC)->hide(); |
---|
93 | itC++; |
---|
94 | } |
---|
95 | |
---|
96 | this->hide(); |
---|
97 | } |
---|
98 | |
---|
99 | |
---|
100 | /** |
---|
101 | * draws the GLGuiBox |
---|
102 | */ |
---|
103 | void GLGuiBox::draw() const |
---|
104 | { |
---|
105 | } |
---|
106 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.