

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. | |
|
|
Starts as empty box.
Definition at line 17 of file HBox.cpp. 00018 {
00019 m_w = 0;
00020 m_h = 0;
00021 }
|
|
|
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 }
|
|
|
Implements IWidget. Definition at line 16 of file HBox.h. 00016 { return m_h; }
|
|
|
Implements IWidget. Definition at line 15 of file HBox.h. 00015 { return m_w; }
|
|
|
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 }
|
1.4.2