Changeset 8003 in orxonox.OLD for branches/gui/src/lib
- Timestamp:
- May 31, 2006, 12:21:36 AM (19 years ago)
- Location:
- branches/gui/src/lib/gui/gl_gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/gui/gl_gui/glgui_box.cc
r8002 r8003 50 50 51 51 this->children.push_back(widget); 52 this->addChild2D(widget); 53 54 this->resize(); 52 55 } 53 56 … … 57 60 assert(widget == NULL); 58 61 59 this->children.remove(widget); 62 std::vector<GLGuiWidget*>::iterator delWidget = std::find(this->children.begin(), this->children.end(), widget); 63 if (delWidget != this->children.end()) 64 this->children.erase(delWidget); 65 } 66 67 void GLGuiBox::clear() 68 { 69 this->children.clear(); 70 this->resize(); 60 71 } 61 72 62 73 void GLGuiBox::showAll() 63 74 { 64 std:: list<GLGuiWidget*>::iterator itC = this->children.begin();75 std::vector<GLGuiWidget*>::iterator itC = this->children.begin(); 65 76 while (itC != this->children.end()) 66 77 { … … 77 88 void GLGuiBox::hideAll() 78 89 { 79 std:: list<GLGuiWidget*>::iterator itC = this->children.begin();90 std::vector<GLGuiWidget*>::iterator itC = this->children.begin(); 80 91 while (itC != this->children.end()) 81 92 { … … 90 101 } 91 102 103 void GLGuiBox::resize() 104 { 105 float height = 0.0f; 106 float width = 0.0f; 107 std::vector<GLGuiWidget*>::iterator widget; 108 109 // find out how big the Widgets are. 110 for (widget = this->children.begin(); widget != this->children.end(); ++widget) 111 { 112 (*widget)->setAbsCoor2D(0, height); 113 height += (*widget)->getSizeY2D(); 114 width = fmax(width, (*widget)->getSizeX2D()); 115 } 116 117 GLGuiWidget::resize(); 118 // resize everything. 119 //for (widget = this->children.begin(); widget != this->children.end(); ++widget) 120 //{} 121 } 92 122 93 123 /** 94 * draws the GLGuiBox124 * @brief draws the GLGuiBox 95 125 */ 96 126 void GLGuiBox::draw() const 97 127 { 128 this->beginDraw(); 129 GLGuiWidget::draw(); 130 this->endDraw(); 98 131 } 99 132 } -
branches/gui/src/lib/gui/gl_gui/glgui_box.h
r8002 r8003 24 24 virtual ~GLGuiBox(); 25 25 26 void init();27 26 /** @returns the Orientation of the Box */ 28 27 OrxGui::Orientation orientation() const { return this->_orientation; }; … … 38 37 virtual void draw() const; 39 38 40 pr ivate:39 protected: 41 40 virtual void resize(); 42 41 43 Orientation _orientation; 44 std::list<GLGuiWidget*> children; 42 private: 43 void init(); 44 45 Orientation _orientation; 46 std::vector<GLGuiWidget*> children; 45 47 }; 46 48 }
Note: See TracChangeset
for help on using the changeset viewer.