Arranges items in a 2-dimensional grid. More...
#include <Sizer.h>
Public Member Functions | |
virtual void | OnCalcSizes () |
virtual void | OnRectChanged (int x, int y, int w, int h) |
virtual size_t | GetItemCount () |
virtual ISizer * | GetItem (size_t i) |
void | SetPadding (int padX, int padY) |
void | SetOuterPadding (int pad) |
void | Add (ISizer *sizer, size_t row, size_t column, size_t spannedRows=1, size_t spannedColumns=1) |
void | Add (HWND window, size_t row, size_t column, size_t spannedRows=1, size_t spannedColumns=1) |
void | Remove (size_t row, size_t column) |
void | RemoveAll () |
void | SetColumnProportion (size_t column, int proportion) |
void | SetColumnItemsSameWidth (size_t column, bool set) |
void | SetRowProportion (size_t row, int proportion) |
void | SetRowItemsSameHeight (size_t row, bool set) |
size_t | GetNumRows () |
size_t | GetNumColumns () |
![]() | |
void | CalcSizes () |
SizerSize | GetMinSize () |
void | Move (int x, int y, int w, int h) |
void | Move (const SizerPoint &p, const SizerSize &s) |
void | Move (const SizerRect &r) |
SizerRect | GetRect () const |
void | WmSize (UINT type, int cx, int cy) |
void | WmGetMinMaxInfo (HWND window, MINMAXINFO *mmi) |
Additional Inherited Members | |
![]() | |
bool | dirty |
SizerRect | rect |
SizerSize | minimumSize |
Arranges items in a 2-dimensional grid.
void GridSizer::Add | ( | ISizer * | sizer, |
size_t | row, | ||
size_t | column, | ||
size_t | spannedRows = 1 , |
||
size_t | spannedColumns = 1 |
||
) |
Add sizer at the specified row and column.
row | First row that this sizer should occupy. |
column | First column that this sizer should occupy. |
spannedRows | Greater than 1 if the sizer should be spanned across rows. |
spannedColumns | Greater than 1 if the sizer should be spanned across columns. |
|
inline |
Shortcut to add a window.
|
inlinevirtual |
i | Index of the sizer item to get. GetItemCount() returns the maximum for this index. |
Reimplemented from ISizer.
|
inlinevirtual |
|
inline |
|
inline |
|
virtual |
Calculates sizes, but does not move the sizer in any way.
Implements ISizer.
|
virtual |
Moves the sizer and all children.
This function will always be called, even if the sizer is not dirty.
Implements ISizer.
void GridSizer::Remove | ( | size_t | row, |
size_t | column | ||
) |
Removes a sizer from the grid. If the specified sizer is spanned, then the entire span is removed, not just row/column.
void GridSizer::RemoveAll | ( | ) |
Removes all items.
void GridSizer::SetColumnItemsSameWidth | ( | size_t | column, |
bool | set | ||
) |
Default is False.
set | If True, items will be stretched to the column width. If False, the item minimum size is used. Only works with proportion = 0. |
void GridSizer::SetColumnProportion | ( | size_t | column, |
int | proportion | ||
) |
proportion | Columns are stretched by their proportion. If this is 0, minimum size is used. |
void GridSizer::SetOuterPadding | ( | int | pad | ) |
Set padding around this sizer.
void GridSizer::SetPadding | ( | int | padX, |
int | padY | ||
) |
Set padding between items.
void GridSizer::SetRowItemsSameHeight | ( | size_t | row, |
bool | set | ||
) |
Default is False.
set | If True, items will be stretched to the row height. If False, the item minimum size is used. Only works with proportion = 0. |
void GridSizer::SetRowProportion | ( | size_t | row, |
int | proportion | ||
) |
proportion | Rows are stretched by their proportion. If this is 0, minimum size is used. |