This class contains a rectangular array of cells.
More...
#include <layout.h>
|
| LayoutArray () |
|
| ~LayoutArray () |
|
LayoutCell & | at (int x, int y, int w=1, int h=1) |
| Returns a reference on the cell at given position.
|
|
LayoutCell & | place (gcn::Widget *, int x, int y, int w=1, int h=1) |
| Places a widget in a given cell.
|
|
void | setColWidth (int n, int w) |
| Sets the minimum width of a column.
|
|
void | setRowHeight (int n, int h) |
| Sets the minimum height of a row.
|
|
void | matchColWidth (int n1, int n2) |
| Sets the widths of two columns to the maximum of their widths.
|
|
void | extend (int x, int y, int w, int h) |
| Spawns a cell over several columns/rows.
|
|
void | reflow (int nX, int nY, int nW, int nH) |
| Computes and sets the positions of all the widgets.
|
|
|
| LayoutArray (LayoutArray const &) |
|
LayoutArray & | operator= (LayoutArray const &) |
|
void | align (int &pos, int &size, int dim, LayoutCell const &cell, const short *sizes) const |
| Gets the position and size of a widget along a given axis.
|
|
void | resizeGrid (int w, int h) |
| Ensures the private vectors are large enough.
|
|
std::vector< short > | getSizes (int dim, int upp) const |
| Gets the column/row sizes along a given axis.
|
|
int | getSize (int dim) const |
| Gets the total size along a given axis.
|
|
This class contains a rectangular array of cells.
Definition at line 66 of file layout.h.
◆ LayoutArray() [1/2]
LayoutArray::LayoutArray |
( |
| ) |
|
◆ ~LayoutArray()
LayoutArray::~LayoutArray |
( |
| ) |
|
◆ LayoutArray() [2/2]
◆ align()
void LayoutArray::align |
( |
int & |
pos, |
|
|
int & |
size, |
|
|
int |
dim, |
|
|
LayoutCell const & |
cell, |
|
|
const short * |
sizes |
|
) |
| const |
|
private |
Gets the position and size of a widget along a given axis.
Definition at line 190 of file layout.cpp.
◆ at()
LayoutCell & LayoutArray::at |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w = 1 , |
|
|
int |
h = 1 |
|
) |
| |
Returns a reference on the cell at given position.
Definition at line 104 of file layout.cpp.
◆ extend()
void LayoutArray::extend |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Spawns a cell over several columns/rows.
Definition at line 161 of file layout.cpp.
◆ getSize()
int LayoutArray::getSize |
( |
int |
dim | ) |
const |
|
private |
Gets the total size along a given axis.
Definition at line 274 of file layout.cpp.
◆ getSizes()
std::vector< short > LayoutArray::getSizes |
( |
int |
dim, |
|
|
int |
upp |
|
) |
| const |
|
private |
Gets the column/row sizes along a given axis.
- Parameters
-
upp | target size for the array. Ignored if AUTO_DEF. |
Definition at line 214 of file layout.cpp.
◆ matchColWidth()
void LayoutArray::matchColWidth |
( |
int |
n1, |
|
|
int |
n2 |
|
) |
| |
Sets the widths of two columns to the maximum of their widths.
Definition at line 152 of file layout.cpp.
◆ operator=()
◆ place()
LayoutCell & LayoutArray::place |
( |
gcn::Widget * |
widget, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w = 1 , |
|
|
int |
h = 1 |
|
) |
| |
Places a widget in a given cell.
- Parameters
-
w | number of columns the widget spawns. |
h | number of rows the widget spawns. |
- Note
- When w is 1, the width of column x is reset to zero if it was AUTO_DEF. Similarly for h.
Definition at line 168 of file layout.cpp.
◆ reflow()
void LayoutArray::reflow |
( |
int |
nX, |
|
|
int |
nY, |
|
|
int |
nW, |
|
|
int |
nH |
|
) |
| |
Computes and sets the positions of all the widgets.
- Parameters
-
nW | width of the array, used to resize the AUTO_ columns. |
nH | height of the array, used to resize the AUTO_ rows. |
Definition at line 287 of file layout.cpp.
◆ resizeGrid()
void LayoutArray::resizeGrid |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
private |
Ensures the private vectors are large enough.
Definition at line 115 of file layout.cpp.
◆ setColWidth()
void LayoutArray::setColWidth |
( |
int |
n, |
|
|
int |
w |
|
) |
| |
Sets the minimum width of a column.
Definition at line 140 of file layout.cpp.
◆ setRowHeight()
void LayoutArray::setRowHeight |
( |
int |
n, |
|
|
int |
h |
|
) |
| |
Sets the minimum height of a row.
Definition at line 146 of file layout.cpp.
◆ LayoutCell
◆ mCells
std::vector< std::vector < LayoutCell * > > LayoutArray::mCells |
|
private |
◆ mSizes
std::vector< short > LayoutArray::mSizes[2] |
|
private |
◆ mSpacing
char LayoutArray::mSpacing |
|
private |
The documentation for this class was generated from the following files: