- Timestamp:
- Jul 30, 2006, 9:22:00 PM (18 years ago)
- Location:
- branches/proxy/src/lib/gui/gl
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/gui/gl/glgui_box.cc
r9110 r9620 36 36 */ 37 37 GLGuiBox::~GLGuiBox() 38 {} 38 { 39 // unpack all the widgets. 40 while(!this->_children.empty()) 41 { 42 /// not deleting children here. 43 this->_children.front()->setParentWidget(NULL); 44 this->_children.pop_front(); 45 } 46 } 39 47 40 48 /** … … 50 58 assert (widget != NULL); 51 59 52 this-> children.push_back(widget);60 this->_children.push_back(widget); 53 61 widget->setParentWidget(this); 54 62 … … 61 69 assert(widget != NULL); 62 70 63 std:: vector<GLGuiWidget*>::iterator delWidget = std::find(this->children.begin(), this->children.end(), widget);64 if (delWidget != this-> children.end())71 std::list<GLGuiWidget*>::iterator delWidget = std::find(this->_children.begin(), this->_children.end(), widget); 72 if (delWidget != this->_children.end()) 65 73 { 66 74 (*delWidget)->setParentWidget(NULL); 67 this-> children.erase(delWidget);75 this->_children.erase(delWidget); 68 76 } 69 77 this->resize(); … … 72 80 void GLGuiBox::clear() 73 81 { 74 this-> children.clear();82 this->_children.clear(); 75 83 this->resize(); 76 84 } … … 78 86 void GLGuiBox::showAll() 79 87 { 80 std:: vector<GLGuiWidget*>::iterator itC = this->children.begin();81 while (itC != this-> children.end())88 std::list<GLGuiWidget*>::iterator itC = this->_children.begin(); 89 while (itC != this->_children.end()) 82 90 { 83 91 if ((*itC)->isA(CL_GLGUI_CONTAINER)) … … 93 101 void GLGuiBox::hideAll() 94 102 { 95 std:: vector<GLGuiWidget*>::iterator itC = this->children.begin();96 while (itC != this-> children.end())103 std::list<GLGuiWidget*>::iterator itC = this->_children.begin(); 104 while (itC != this->_children.end()) 97 105 { 98 106 if ((*itC)->isA(CL_GLGUI_CONTAINER)) … … 112 120 float height = borderTop(); 113 121 float width = 0.0f; 114 std:: vector<GLGuiWidget*>::iterator widget;122 std::list<GLGuiWidget*>::iterator widget; 115 123 116 124 // find out how big the Widgets are. 117 for (widget = this-> children.begin(); widget != this->children.end(); ++widget)125 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 118 126 { 119 127 (*widget)->setRelCoor2D(borderLeft(), height); … … 131 139 float height = borderTop(); 132 140 float width = borderLeft(); 133 std:: vector<GLGuiWidget*>::iterator widget;141 std::list<GLGuiWidget*>::iterator widget; 134 142 135 143 // find out how big the Widgets are. 136 for (widget = this-> children.begin(); widget != this->children.end(); ++widget)144 for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 137 145 { 138 146 (*widget)->setRelCoor2D(width, borderTop()); … … 149 157 150 158 // resize everything. 151 //for (widget = this-> children.begin(); widget != this->children.end(); ++widget)159 //for (widget = this->_children.begin(); widget != this->_children.end(); ++widget) 152 160 //{} 153 161 } -
branches/proxy/src/lib/gui/gl/glgui_box.h
r9546 r9620 30 30 31 31 virtual void pack(GLGuiWidget* widget); 32 void pack(GLGuiWidget* widget, std::list<GLGuiWidget*>::iterator pos); 33 void pack(GLGuiWidget* widget, unsigned int position); 34 //void 32 35 virtual void unpack(GLGuiWidget* widget); 33 36 virtual void clear(); … … 45 48 46 49 Orientation _orientation; 47 std:: vector<GLGuiWidget*>children;50 std::list<GLGuiWidget*> _children; 48 51 }; 49 52 } -
branches/proxy/src/lib/gui/gl/glgui_container.cc
r8619 r9620 48 48 49 49 50 void GLGuiContainer::removeChildWidget(GLGuiWidget* widget) 51 { 52 this->unpack(widget); 53 } 54 55 50 56 /** 51 57 * draws the GLGuiContainer -
branches/proxy/src/lib/gui/gl/glgui_container.h
r8145 r9620 38 38 virtual void draw(); 39 39 40 protected: 41 virtual void removeChildWidget(GLGuiWidget* widget); 42 40 43 private: 41 44 void init(); -
branches/proxy/src/lib/gui/gl/glgui_widget.cc
r9406 r9620 79 79 if (this == GLGuiWidget::selected()) 80 80 this->unselect(); 81 82 if (this->_parent != NULL) 83 this->_parent->removeChildWidget(this); 81 84 } 82 85 -
branches/proxy/src/lib/gui/gl/glgui_widget.h
r9406 r9620 270 270 virtual void destroying(); 271 271 272 // unparent the widget and from this widget seen as parent 273 virtual void removeChildWidget(GLGuiWidget* widget) {}; 274 272 275 273 276 virtual void debug(unsigned int level) const;
Note: See TracChangeset
for help on using the changeset viewer.