Grid Class
Package: GHIElectronics.Endpoint.UI
Namespace: GHIElectronics.Endpoint.UI
WPF-style Grid with ColumnDefinitions + RowDefinitions. Call Grid.SetDefinitions once with the column + row sizes, then call Grid.SetCell on each child. Sizes: positive = fixed pixels; 0 or negative = star (-1 = "", -2 = "2", ...).
class Grid : public Widget {};
Constructors
Grid(Widget parent)
Grid(const Widget& parent);
Create a grid inside parent.
| Parameter | Type | Description |
|---|---|---|
parent | Widget | Containing widget. |
Methods
SetCell(Widget child, int column, int row, int columnSpan, int rowSpan)
static void SetCell(const Widget& child, int32_t column, int32_t row, int32_t columnSpan, int32_t rowSpan);
Attach child to a cell in the grid.
SetDefinitions(int[] columns, int[] rows)
void SetDefinitions(const std::vector<int32_t>& columns, const std::vector<int32_t>& rows);
Define column and row sizes. Positive values are fixed pixel widths; a negative value -n is a star share of weight n (-1 = *, -2 = 2*, ...). Zero is treated as star.
| Parameter | Type | Description |
|---|---|---|
columns | int[] | Column size definitions, left to right. |
rows | int[] | Row size definitions, top to bottom. |