Mana
|
This class is an helper for setting the position of widgets. More...
#include <layout.h>
Public Types | |
enum | { AUTO_DEF = -42 , AUTO_SET = -43 , AUTO_ADD = -44 } |
When the minimum size of the layout is less than the available size, the remaining pixels are equally split amongst the FILL items. More... | |
![]() | |
enum | Alignment { LEFT , RIGHT , CENTER , FILL } |
Public Member Functions | |
Layout () | |
void | setMargin (int m) |
Sets the margin around the layout. | |
void | reflow (int &nW, int &nH) |
Sets the positions of all the widgets. | |
![]() | |
LayoutCell ()=default | |
~LayoutCell () | |
LayoutCell (LayoutCell const &)=delete | |
LayoutCell & | operator= (LayoutCell const &)=delete |
LayoutCell & | setPadding (int p) |
Sets the padding around the cell content. | |
LayoutCell & | setHAlign (Alignment a) |
Sets the horizontal alignment of the cell content. | |
LayoutCell & | setVAlign (Alignment a) |
Sets the vertical alignment of the cell content. | |
LayoutCell & | at (int x, int y) |
LayoutCell & | place (gcn::Widget *wg, int x, int y, int w=1, int h=1) |
void | matchColWidth (int n1, int n2) |
void | setColWidth (int n, int w) |
void | setRowHeight (int n, int h) |
void | extend (int x, int y, int w, int h) |
void | computeSizes () |
Sets the minimum widths and heights of this cell and of all the inner cells. | |
Private Attributes | |
bool | mComputed |
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.
anonymous enum |
Layout::Layout | ( | ) |
Definition at line 315 of file layout.cpp.
void Layout::reflow | ( | int & | nW, |
int & | nH | ||
) |
Sets the positions of all the widgets.
Definition at line 321 of file layout.cpp.
|
inline |