Changeset 5393 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_box.cc
- Timestamp:
- Oct 16, 2005, 2:28:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl_gui/glgui_box.cc
r5391 r5393 18 18 #include "glgui_box.h" 19 19 20 #include "list.h" 21 20 22 using namespace std; 21 23 … … 36 38 GLGuiBox::~GLGuiBox() 37 39 { 38 40 delete this->children; 39 41 } 40 42 … … 45 47 { 46 48 this->setClassID(CL_GLGUI_BOX, "GLGuiBox"); 49 this->children = new tList<GLGuiWidget>; 50 } 51 52 void GLGuiBox::pack(GLGuiWidget* widget) 53 { 54 if (widget == NULL) 55 return; 56 57 this->children->add(widget); 58 } 59 60 61 void GLGuiBox::unpack(GLGuiWidget* widget) 62 { 63 if (widget == NULL) 64 { 65 delete this->children; 66 this->children = new tList<GLGuiWidget>; 67 } 68 else 69 { 70 this->children->remove(widget); 71 } 72 } 73 74 void GLGuiBox::showAll() 75 { 76 tIterator<GLGuiWidget>* itC = this->children->getIterator(); 77 GLGuiWidget* enumC = itC->firstElement(); 78 while (enumC != NULL) 79 { 80 if (enumC->isA(CL_GLGUI_CONTAINER)) 81 static_cast<GLGuiContainer*>(enumC)->showAll(); 82 else 83 enumC->show(); 84 enumC = itC->nextElement(); 85 } 86 delete itC; 87 88 this->show(); 47 89 48 90 } 91 92 void GLGuiBox::hideAll() 93 { 94 tIterator<GLGuiWidget>* itC = this->children->getIterator(); 95 GLGuiWidget* enumC = itC->firstElement(); 96 while (enumC != NULL) 97 { 98 if (enumC->isA(CL_GLGUI_CONTAINER)) 99 static_cast<GLGuiContainer*>(enumC)->showAll(); 100 else 101 enumC->hide(); 102 enumC = itC->nextElement(); 103 } 104 delete itC; 105 106 this->hide(); 107 } 108 49 109 50 110 /**
Note: See TracChangeset
for help on using the changeset viewer.