#include <box.h>
Inheritance diagram for HBox:
Public Member Functions | |
HBox (const Rectanglei &rect, bool _visible=true) | |
void | SetSizePosition (const Rectanglei &rect) |
void | AddWidget (Widget *a_widget) |
Definition at line 64 of file box.h.
HBox::HBox | ( | const Rectanglei & | rect, | |
bool | _visible = true | |||
) |
void HBox::AddWidget | ( | Widget * | a_widget | ) | [virtual] |
Implements Box.
Definition at line 156 of file box.cpp.
00157 { 00158 assert(a_widget != NULL); 00159 00160 uint _x; 00161 00162 if (!widget_list.empty()) 00163 _x = widget_list.back()->GetPositionX() + widget_list.back()->GetSizeX(); 00164 else 00165 _x = position.x + border.x - margin; 00166 00167 a_widget->SetSizePosition( Rectanglei(_x + margin, 00168 position.y + border.y, 00169 a_widget->GetSizeX(), 00170 size.y - 2 * border.y) ); 00171 00172 size.x = a_widget->GetPositionX() + a_widget->GetSizeX() - position.x + border.x; 00173 00174 WidgetList::AddWidget(a_widget); 00175 }
Here is the call graph for this function:
Here is the caller graph for this function:
void HBox::SetSizePosition | ( | const Rectanglei & | rect | ) | [virtual] |
Reimplemented from WidgetList.
Definition at line 177 of file box.cpp.
00178 { 00179 position = rect.GetPosition(); 00180 int _x = rect.GetPositionX(); 00181 00182 std::list<Widget *>::iterator it; 00183 for( it = widget_list.begin(); 00184 it != widget_list.end(); 00185 ++it ){ 00186 00187 if( it == widget_list.begin() ) 00188 _x += border.x - margin; 00189 00190 (*it)->SetSizePosition( Rectanglei(_x + margin, 00191 position.y + border.y, 00192 (*it)->GetSizeX(), 00193 (*it)->GetSizeY()) ); 00194 _x = (*it)->GetPositionX()+ (*it)->GetSizeX(); 00195 } 00196 }
Here is the call graph for this function:
Here is the caller graph for this function: