Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

HBox Class Reference

Inheritance diagram for HBox:

Inheritance graph
[legend]
Collaboration diagram for HBox:

Collaboration graph
[legend]

Detailed Description

Horizontal box.

Definition at line 9 of file HBox.h.

Public Member Functions

 HBox ()
 Starts as empty box.
virtual int getW () const
virtual int getH () const
virtual void addWidget (IWidget *new_widget)
 Place widget to the most right place.
virtual void setShift (const V2 &shift)
 Update shift for all subwidgets.


Constructor & Destructor Documentation

HBox::HBox  ) 
 

Starts as empty box.

Definition at line 17 of file HBox.cpp.

00018 {
00019     m_w = 0;
00020     m_h = 0;
00021 }


Member Function Documentation

void HBox::addWidget IWidget new_widget  )  [virtual]
 

Place widget to the most right place.

Implements WiBox.

Definition at line 27 of file HBox.cpp.

00028 {
00029     m_widgets.push_back(new_widget);
00030     new_widget->setShift(m_shift.plus(V2(m_w, 0)));
00031     m_w += new_widget->getW();
00032     m_h = max(m_h, new_widget->getH());
00033 }

virtual int HBox::getH  )  const [inline, virtual]
 

Implements IWidget.

Definition at line 16 of file HBox.h.

00016 { return m_h; }

virtual int HBox::getW  )  const [inline, virtual]
 

Implements IWidget.

Definition at line 15 of file HBox.h.

00015 { return m_w; }

void HBox::setShift const V2 shift  )  [virtual]
 

Update shift for all subwidgets.

Reimplemented from IWidget.

Definition at line 39 of file HBox.cpp.

00040 {
00041     m_shift = shift;
00042     int width = 0;
00043     t_widgets::iterator end = m_widgets.end();
00044     for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) {
00045         (*i)->setShift(m_shift.plus(V2(width, 0)));
00046         width += (*i)->getW();
00047     }
00048 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:55:16 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2