

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 |
|
|
|
|
|
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 }
|
|
|
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
|
1.4.2