HBox Class Reference

#include <box.h>

Inheritance diagram for HBox:

Inheritance graph
[legend]
Collaboration diagram for HBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HBox (const Rectanglei &rect, bool _visible=true)
void SetSizePosition (const Rectanglei &rect)
void AddWidget (Widget *a_widget)

Detailed Description

Definition at line 64 of file box.h.


Constructor & Destructor Documentation

HBox::HBox ( const Rectanglei rect,
bool  _visible = true 
)

Definition at line 151 of file box.cpp.

00151                                                 : Box(rect, _visible)
00152 {
00153   size.x = 1;
00154 }

Here is the caller graph for this function:


Member Function Documentation

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:


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:51:38 2007 for Wormux by  doxygen 1.4.7