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

WiBox Class Reference

Inheritance diagram for WiBox:

Inheritance graph
[legend]
Collaboration diagram for WiBox:

Collaboration graph
[legend]

Detailed Description

Box which care about subwidget layout.

NOTE: soubwidgets should have constant size.

Definition at line 12 of file WiBox.h.

Public Member Functions

virtual ~WiBox ()
 Release all subwidgets.
virtual void addWidget (IWidget *new_widget)=0
virtual void drawOn (SDL_Surface *screen)
 Draw all subwidgets.

Protected Types

typedef std::vector< IWidget * > t_widgets

Protected Member Functions

virtual std::string own_getTip (const V2 &loc)
 Returns tooltip for active subwidget.
virtual void own_mouseButton (const MouseStroke &stroke)
 Let all subwidgets to react on button press.

Protected Attributes

t_widgets m_widgets


Member Typedef Documentation

typedef std::vector<IWidget*> WiBox::t_widgets [protected]
 

Definition at line 14 of file WiBox.h.


Constructor & Destructor Documentation

WiBox::~WiBox  )  [virtual]
 

Release all subwidgets.

Definition at line 15 of file WiBox.cpp.

00016 {
00017     t_widgets::iterator end = m_widgets.end();
00018     for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) {
00019         delete *i;
00020     }
00021 }


Member Function Documentation

virtual void WiBox::addWidget IWidget new_widget  )  [pure virtual]
 

Implemented in HBox, and VBox.

void WiBox::drawOn SDL_Surface *  screen  )  [virtual]
 

Draw all subwidgets.

Implements Drawable.

Definition at line 27 of file WiBox.cpp.

00028 {
00029     t_widgets::iterator end = m_widgets.end();
00030     for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) {
00031         (*i)->drawOn(screen);
00032     }
00033 }

std::string WiBox::own_getTip const V2 loc  )  [protected, virtual]
 

Returns tooltip for active subwidget.

Reimplemented from IWidget.

Definition at line 39 of file WiBox.cpp.

00040 {
00041     if (!m_tip.empty()) {
00042         return m_tip;
00043     }
00044 
00045     std::string result;
00046     t_widgets::iterator end = m_widgets.end();
00047     for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) {
00048         result = (*i)->getTip(loc);
00049         if (!result.empty()) {
00050             return result;
00051         }
00052     }
00053     return result;
00054 }

void WiBox::own_mouseButton const MouseStroke stroke  )  [protected, virtual]
 

Let all subwidgets to react on button press.

Reimplemented from IWidget.

Definition at line 60 of file WiBox.cpp.

00061 {
00062     t_widgets::iterator end = m_widgets.end();
00063     for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) {
00064         (*i)->mouseButton(stroke);
00065     }
00066 }


Field Documentation

t_widgets WiBox::m_widgets [protected]
 

Definition at line 15 of file WiBox.h.


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