Mana
|
A helper class for adding a layout to a Guichan container widget. More...
#include <layouthelper.h>
Public Member Functions | |
LayoutHelper (gcn::Container *container) | |
~LayoutHelper () override | |
Layout & | getLayout () |
Gets the layout handler. | |
void | reflowLayout (int w=0, int h=0) |
Computes the position of the widgets according to the current layout. | |
LayoutCell & | place (int x, int y, gcn::Widget *, int w=1, int h=1) |
Adds a widget to the container and sets it at given cell. | |
ContainerPlacer | getPlacer (int x, int y) |
Returns a proxy for adding widgets in an inner table of the layout. | |
void | widgetResized (const gcn::Event &event) override |
Called whenever the managed container changes size. | |
Private Attributes | |
Layout | mLayout |
Layout handler. | |
gcn::Container * | mContainer |
Managed container. | |
A helper class for adding a layout to a Guichan container widget.
The layout will register itself as a widget listener and relayout the widgets in the container dynamically on resize.
Definition at line 33 of file layouthelper.h.
|
explicit |
Definition at line 24 of file layouthelper.cpp.
|
override |
Definition at line 30 of file layouthelper.cpp.
|
inline |
Gets the layout handler.
Definition at line 43 of file layouthelper.h.
ContainerPlacer LayoutHelper::getPlacer | ( | int | x, |
int | y | ||
) |
Returns a proxy for adding widgets in an inner table of the layout.
Definition at line 41 of file layouthelper.cpp.
LayoutCell & LayoutHelper::place | ( | int | x, |
int | y, | ||
gcn::Widget * | wg, | ||
int | w = 1 , |
||
int | h = 1 |
||
) |
Adds a widget to the container and sets it at given cell.
Definition at line 35 of file layouthelper.cpp.
void LayoutHelper::reflowLayout | ( | int | w = 0 , |
int | h = 0 |
||
) |
Computes the position of the widgets according to the current layout.
Resizes the managed container so that the layout fits.
w | if non-zero, force the container to this width. |
h | if non-zero, force the container to this height. |
Definition at line 46 of file layouthelper.cpp.
|
override |
Called whenever the managed container changes size.
Definition at line 52 of file layouthelper.cpp.
|
private |
Managed container.
Definition at line 74 of file layouthelper.h.
|
private |
Layout handler.
Definition at line 73 of file layouthelper.h.