24#include <guichan/widgets/container.hpp>
56 (
int x,
int y, gcn::Widget *,
int w = 1,
int h = 1);
108 void extend(
int x,
int y,
int w,
int h);
115 void reflow(
int nX,
int nY,
int nW,
int nH);
126 void align(
int &pos,
int &size,
int dim,
127 LayoutCell const &cell,
const short *sizes)
const;
138 std::vector< short >
getSizes(
int dim,
int upp)
const;
146 std::vector< std::vector < LayoutCell * > >
mCells;
186 {
mAlign[0] = a;
return *
this; }
192 {
mAlign[1] = a;
return *
this; }
257 void reflow(
int nx,
int ny,
int nw,
int nh);
295 void reflow(
int &nW,
int &nH);
This class is a helper for adding widgets to nested tables in a window.
ContainerPlacer(gcn::Container *c=nullptr, LayoutCell *l=nullptr)
LayoutCell & getCell()
Gets the pointed cell.
gcn::Container * mContainer
ContainerPlacer at(int x, int y)
Returns a placer for the same container but to an inner cell.
This class contains a rectangular array of cells.
std::vector< std::vector< LayoutCell * > > mCells
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.
std::vector< short > mSizes[2]
void setColWidth(int n, int w)
Sets the minimum width of a column.
LayoutArray(LayoutArray const &)
void reflow(int nX, int nY, int nW, int nH)
Computes and sets the positions of all the widgets.
void matchColWidth(int n1, int n2)
Sets the widths of two columns to the maximum of their widths.
int getSize(int dim) const
Gets the total size along a given axis.
void extend(int x, int y, int w, int h)
Spawns a cell over several columns/rows.
void resizeGrid(int w, int h)
Ensures the private vectors are large enough.
LayoutCell & place(gcn::Widget *, int x, int y, int w=1, int h=1)
Places a widget in a given cell.
std::vector< short > getSizes(int dim, int upp) const
Gets the column/row sizes along a given axis.
void setRowHeight(int n, int h)
Sets the minimum height of a row.
LayoutCell & at(int x, int y, int w=1, int h=1)
Returns a reference on the cell at given position.
LayoutArray & operator=(LayoutArray const &)
This class describes the formatting of a widget in the cell of a layout table.
void setRowHeight(int n, int h)
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
LayoutCell(LayoutCell const &)=delete
void reflow(int nx, int ny, int nw, int nh)
void setColWidth(int n, int w)
LayoutCell & operator=(LayoutCell const &)=delete
void matchColWidth(int n1, int n2)
LayoutCell & place(gcn::Widget *wg, int x, int y, int w=1, int h=1)
LayoutCell & setVAlign(Alignment a)
Sets the vertical alignment of the cell content.
LayoutCell & setHAlign(Alignment a)
Sets the horizontal alignment of the cell content.
void extend(int x, int y, int w, int h)
LayoutCell & at(int x, int y)
LayoutArray & getArray()
Returns the embedded array.
void computeSizes()
Sets the minimum widths and heights of this cell and of all the inner cells.
This class is an helper for setting the position of widgets.
void reflow(int &nW, int &nH)
Sets the positions of all the widgets.
@ AUTO_ADD
Adds the share to the current size.
@ AUTO_SET
Uses the share as the new size.
@ AUTO_DEF
Default value, behaves like AUTO_ADD.
void setMargin(int m)
Sets the margin around the layout.