#include <box.h>
Inheritance diagram for VBox:
Public Member Functions | |
VBox (const Rectanglei &rect, bool _visible=true) | |
void | DelFirstWidget () |
void | SetSizePosition (const Rectanglei &rect) |
void | AddWidget (Widget *a_widget) |
Definition at line 55 of file box.h.
VBox::VBox | ( | const Rectanglei & | rect, | |
bool | _visible = true | |||
) |
void VBox::AddWidget | ( | Widget * | a_widget | ) | [virtual] |
Implements Box.
Definition at line 109 of file box.cpp.
00110 { 00111 assert(a_widget != NULL); 00112 00113 uint _y; 00114 00115 if(!widget_list.empty()) 00116 _y = widget_list.back()->GetPositionY() + widget_list.back()->GetSizeY(); 00117 else 00118 _y = position.y + border.y - margin; 00119 00120 a_widget->SetSizePosition(Rectanglei(position.x + border.x, 00121 _y + margin, 00122 size.x - 2 * border.x, 00123 a_widget->GetSizeY() )); 00124 00125 size.y = a_widget->GetPositionY() + a_widget->GetSizeY() - position.y + border.y; 00126 WidgetList::AddWidget(a_widget); 00127 }
Here is the call graph for this function:
Here is the caller graph for this function:
void VBox::DelFirstWidget | ( | ) | [virtual] |
Reimplemented from WidgetList.
Definition at line 95 of file box.cpp.
00096 { 00097 int w_height = widget_list.front()->GetSizeY(); 00098 WidgetList::DelFirstWidget(); 00099 //Make all remaining widget go up: 00100 for( std::list<Widget*>::iterator it = widget_list.begin(); 00101 it != widget_list.end(); 00102 ++it ) 00103 { 00104 (*it)->SetPositionY((*it)->GetPositionY() - w_height - margin); 00105 } 00106 size.y -= w_height + margin; 00107 }
Here is the call graph for this function:
void VBox::SetSizePosition | ( | const Rectanglei & | rect | ) | [virtual] |
Reimplemented from WidgetList.
Definition at line 129 of file box.cpp.
00130 { 00131 position = rect.GetPosition(); 00132 int _y = rect.GetPositionY(); 00133 std::list<Widget *>::iterator it; 00134 for( it = widget_list.begin(); 00135 it != widget_list.end(); 00136 ++it ){ 00137 00138 if( it == widget_list.begin() ) 00139 _y += border.y - margin; 00140 00141 (*it)->SetSizePosition( Rectanglei(position.x + border.x, 00142 _y + margin, 00143 (*it)->GetSizeX(), 00144 (*it)->GetSizeY() )); 00145 _y = (*it)->GetPositionY() + (*it)->GetSizeY(); 00146 } 00147 }
Here is the call graph for this function: