source:
orxonox.OLD/trunk/src/lib/gui/gl/glgui_frame.cc
@
10613
Last change on this file since 10613 was 9869, checked in by bensch, 18 years ago | |
---|---|
File size: 1.8 KB |
Rev | Line | |
---|---|---|
[4744] | 1 | /* |
[1853] | 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. | |
[1855] | 10 | |
11 | ### File Specific: | |
[5360] | 12 | main-programmer: Benjamin Grauer |
[1855] | 13 | co-programmer: ... |
[1853] | 14 | */ |
15 | ||
[5360] | 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI |
[1853] | 17 | |
[5364] | 18 | #include "glgui_frame.h" |
[1853] | 19 | |
[5393] | 20 | #include "debug.h" |
[7779] | 21 | namespace OrxGui |
[3365] | 22 | { |
[9869] | 23 | ObjectListDefinition(GLGuiFrame); |
[7779] | 24 | /** |
25 | * standard constructor | |
26 | */ | |
27 | GLGuiFrame::GLGuiFrame () | |
28 | { | |
29 | this->init(); | |
[1853] | 30 | |
[7779] | 31 | } |
[1853] | 32 | |
[5360] | 33 | |
[7779] | 34 | /** |
35 | * standard deconstructor | |
36 | */ | |
37 | GLGuiFrame::~GLGuiFrame() | |
[5393] | 38 | { |
39 | } | |
[5360] | 40 | |
[7779] | 41 | /** |
42 | * initializes the GUI-element | |
43 | */ | |
44 | void GLGuiFrame::init() | |
45 | { | |
[9869] | 46 | this->registerObject(this, GLGuiFrame::_objectList); |
[5393] | 47 | this->child = NULL; |
[7779] | 48 | } |
[5393] | 49 | |
[7779] | 50 | void GLGuiFrame::pack(GLGuiWidget* widget) |
[5393] | 51 | { |
[7779] | 52 | if (widget == NULL) |
53 | return; | |
54 | ||
55 | if (this->child == NULL) | |
56 | this->child = widget; | |
[5393] | 57 | else |
[7779] | 58 | { |
[9406] | 59 | PRINTF(2)("Frame %s is already filled, not filling with %s\n", this->getCName(), widget->getCName()); |
[7779] | 60 | } |
[5393] | 61 | } |
62 | ||
[7779] | 63 | void GLGuiFrame::unpack(GLGuiWidget* widget) |
[5393] | 64 | { |
[7779] | 65 | if (widget == NULL || widget == this->child) |
66 | this->child = NULL; | |
[5393] | 67 | } |
68 | ||
[7779] | 69 | void GLGuiFrame::showAll() |
70 | { | |
71 | if (this->child != NULL) | |
72 | { | |
[9869] | 73 | if (this->child->isA(GLGuiContainer::staticClassID())) |
[7779] | 74 | static_cast<GLGuiContainer*>(this->child)->showAll(); |
75 | else | |
76 | this->child->show(); | |
77 | } | |
78 | this->show(); | |
79 | } | |
[5393] | 80 | |
[7779] | 81 | void GLGuiFrame::hideAll() |
82 | { | |
83 | if (this->child != NULL) | |
84 | { | |
[9869] | 85 | if (this->child->isA(GLGuiContainer::staticClassID())) |
[7779] | 86 | static_cast<GLGuiContainer*>(this->child)->hideAll(); |
87 | else | |
88 | this->child->hide(); | |
89 | } | |
90 | this->hide(); | |
91 | } | |
[5360] | 92 | |
[7779] | 93 | |
94 | /** | |
95 | * draws the GLGuiFrame | |
96 | */ | |
97 | void GLGuiFrame::draw() | |
98 | { | |
99 | } | |
[5360] | 100 | } |
Note: See TracBrowser
for help on using the repository browser.