Changeset 7130 in orxonox.OLD for trunk/src/lib/gui/gl_gui
- Timestamp:
- Feb 13, 2006, 2:59:17 PM (19 years ago)
- Location:
- trunk/src/lib/gui/gl_gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/gui/gl_gui/glgui_box.cc
r6287 r7130 18 18 #include "glgui_box.h" 19 19 20 #include "list.h"21 22 20 using namespace std; 23 21 … … 38 36 GLGuiBox::~GLGuiBox() 39 37 { 40 delete this->children;41 38 } 42 39 … … 47 44 { 48 45 this->setClassID(CL_GLGUI_BOX, "GLGuiBox"); 49 this->children = new tList<GLGuiWidget>;50 46 } 51 47 … … 55 51 return; 56 52 57 this->children ->add(widget);53 this->children.push_back(widget); 58 54 } 59 55 … … 63 59 if (widget == NULL) 64 60 { 65 delete this->children; 66 this->children = new tList<GLGuiWidget>; 61 this->children.clear(); 67 62 } 68 63 else 69 64 { 70 this->children ->remove(widget);65 this->children.remove(widget); 71 66 } 72 67 } … … 74 69 void GLGuiBox::showAll() 75 70 { 76 tIterator<GLGuiWidget>* itC = this->children->getIterator(); 77 GLGuiWidget* enumC = itC->firstElement(); 78 while (enumC != NULL) 71 std::list<GLGuiWidget*>::iterator itC = this->children.begin(); 72 while (itC != this->children.end()) 79 73 { 80 if ( enumC->isA(CL_GLGUI_CONTAINER))81 static_cast<GLGuiContainer*>( enumC)->showAll();74 if ((*itC)->isA(CL_GLGUI_CONTAINER)) 75 static_cast<GLGuiContainer*>(*itC)->showAll(); 82 76 else 83 enumC->show();84 enumC = itC->nextElement();77 (*itC)->show(); 78 itC++; 85 79 } 86 delete itC;87 80 88 81 this->show(); … … 92 85 void GLGuiBox::hideAll() 93 86 { 94 tIterator<GLGuiWidget>* itC = this->children->getIterator(); 95 GLGuiWidget* enumC = itC->firstElement(); 96 while (enumC != NULL) 87 std::list<GLGuiWidget*>::iterator itC = this->children.begin(); 88 while (itC != this->children.end()) 97 89 { 98 if ( enumC->isA(CL_GLGUI_CONTAINER))99 static_cast<GLGuiContainer*>( enumC)->showAll();90 if ((*itC)->isA(CL_GLGUI_CONTAINER)) 91 static_cast<GLGuiContainer*>(*itC)->hideAll(); 100 92 else 101 enumC->hide();102 enumC = itC->nextElement();93 (*itC)->hide(); 94 itC++; 103 95 } 104 delete itC;105 96 106 97 this->hide(); -
trunk/src/lib/gui/gl_gui/glgui_box.h
r6287 r7130 11 11 12 12 // FORWARD DECLARATION 13 template<class T> class tList;14 13 15 14 typedef enum … … 41 40 private: 42 41 GLGuiBoxType type; 43 tList<GLGuiWidget>* children; 44 42 std::list<GLGuiWidget*> children; 45 43 }; 46 44
Note: See TracChangeset
for help on using the changeset viewer.