Changeset 8017 in orxonox.OLD
- Timestamp:
- May 31, 2006, 11:17:33 AM (18 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
r8016 r8017 62 62 std::vector<GLGuiWidget*>::iterator delWidget = std::find(this->children.begin(), this->children.end(), widget); 63 63 if (delWidget != this->children.end()) 64 { 65 (*delWidget)->setParentWidget(NULL); 64 66 this->children.erase(delWidget); 67 } 68 this->resize(); 65 69 } 66 70 … … 103 107 void GLGuiBox::resize() 104 108 { 105 float height = this->borderSize(); 106 float width = 0.0f; 107 std::vector<GLGuiWidget*>::iterator widget; 109 if (orientation() == OrxGui::Vertical) 110 { 111 float height = this->borderSize(); 112 float width = 0.0f; 113 std::vector<GLGuiWidget*>::iterator widget; 108 114 109 // find out how big the Widgets are. 110 for (widget = this->children.begin(); widget != this->children.end(); ++widget) 115 // find out how big the Widgets are. 116 for (widget = this->children.begin(); widget != this->children.end(); ++widget) 117 { 118 (*widget)->setRelCoor2D(this->borderSize(), height); 119 height += (*widget)->getSizeY2D(); 120 width = fmax(width, (*widget)->getSizeX2D()); 121 } 122 123 width += this->borderSize() * 2.0; 124 height += this->borderSize(); /* *2 done further up */ 125 126 printf("%f %f\n", width, height); 127 this->setSize2D(width, height); 128 } 129 else 111 130 { 112 (*widget)->setRelCoor2D(this->borderSize(), height); 113 height += (*widget)->getSizeY2D(); 114 width = fmax(width, (*widget)->getSizeX2D()); 131 float height = this->borderSize(); 132 float width = this->borderSize(); 133 std::vector<GLGuiWidget*>::iterator widget; 134 135 // find out how big the Widgets are. 136 for (widget = this->children.begin(); widget != this->children.end(); ++widget) 137 { 138 (*widget)->setRelCoor2D(width, this->borderSize()); 139 height = fmax(height, (*widget)->getSizeY2D()); 140 width += (*widget)->getSizeX2D(); 141 } 142 143 width += this->borderSize() ; 144 height += this->borderSize(); /* *2 done further up */ 145 146 printf("%f %f\n", width, height); 147 this->setSize2D(width, height); 115 148 } 149 GLGuiWidget::resize(); 116 150 117 width += this->borderSize() * 2.0;118 height += this->borderSize(); /* *2 done further up */119 120 printf("%f %f\n", width, height);121 this->setSize2D(width, height);122 GLGuiWidget::resize();123 151 // resize everything. 124 152 //for (widget = this->children.begin(); widget != this->children.end(); ++widget) -
branches/gui/src/lib/gui/gl_gui/glgui_box.h
r8003 r8017 21 21 22 22 public: 23 GLGuiBox(OrxGui::Orientation orientation = OrxGui:: Horizontal);23 GLGuiBox(OrxGui::Orientation orientation = OrxGui::Vertical); 24 24 virtual ~GLGuiBox(); 25 25 26 26 /** @returns the Orientation of the Box */ 27 27 OrxGui::Orientation orientation() const { return this->_orientation; }; 28 /** @param orientation the Orientation of the Box */ 28 29 void setOrientation(OrxGui::Orientation orientation) { this->_orientation = orientation; }; 29 30
Note: See TracChangeset
for help on using the changeset viewer.