ManaPlus
|
#include <layout.h>
Public Member Functions | |
Layout () | |
void | setMargin (int m) |
void | reflow (int &nW, int &nH) |
Public Member Functions inherited from LayoutCell | |
virtual | ~LayoutCell () |
LayoutCell & | setPadding (int p) |
int | getVPadding () const |
int | getHPadding () const |
LayoutCell & | setVPadding (int p) |
LayoutCell & | setHPadding (int p) |
LayoutCell & | setHAlign (const Alignment a) |
LayoutCell & | setVAlign (const Alignment a) |
LayoutCell & | at (const int x, const int y) |
LayoutCell & | place (Widget *const wg, const int x, const int y, const int w, const int h) |
void | matchColWidth (const int n1, const int n2) |
void | setColWidth (const int n, const int w) |
void | setRowHeight (const int n, const int h) |
void | extend (const int x, const int y, const int w, const int h) |
void | computeSizes () |
void | setType (int t) |
int | getWidth () const |
int | getHeight () const |
void | setWidth (const int w) |
void | setHeight (const int h) |
Private Attributes | |
bool | mComputed |
Additional Inherited Members | |
Public Types inherited from LayoutCell | |
enum | Alignment { LEFT = 0 , RIGHT , CENTER , FILL } |
enum | { NONE = 0 , WIDGET , ARRAY } |
Static Public Attributes inherited from LayoutCell | |
static LayoutCell | emptyCell |
This class is an helper for setting the position of widgets. They are positioned along the cells of some rectangular tables. The layout may either be a single table or a tree of nested tables.
The size of a given table column can either be set manually or be chosen from the widest widget of the column. An empty column has a AUTO_DEF width, which means it will be extended so that the layout fits its minimum width.
The process is similar for table rows. By default, there is a spacing of 4 pixels between rows and between columns, and a margin of 6 pixels around the whole layout.
Layout::Layout | ( | ) |
Definition at line 28 of file layout.cpp.
References LayoutCell::getArray(), and LayoutCell::setPadding().
void Layout::reflow | ( | int & | nW, |
int & | nH | ||
) |
Sets the positions of all the widgets.
Definition at line 36 of file layout.cpp.
References LayoutCell::computeSizes(), mComputed, LayoutCell::mHPadding, LayoutCell::mSize, LayoutCell::mVPadding, and LayoutCell::reflow().
Referenced by EditServerDialog::EditServerDialog(), Window::redraw(), LayoutHelper::reflowLayout(), Window::reflowLayout(), ServerDialog::ServerDialog(), LayoutHelper::widgetResized(), and Window::widgetResized().
|
inline |
Sets the margin around the layout.
Definition at line 54 of file layout.h.
References LayoutCell::setPadding().
Referenced by ShortcutWindow::ShortcutWindow().