A layout is an area that can be split into multiple cells. Each of these cells can be resized and can act as a Widget container. Layouts in the editor are used as the base of a workspace due to their flexibility.
Name | Description |
margin | Size of the grips in pixels. |
Declaration
|
max_cells | Specify the maximum amount of cells. |
Declaration
|
row_size | Minimum (X ) and maximum (Y ) size of a row in pixels. |
Declaration
|
column_size | Minimum (X ) and maximum (Y ) size of a column in pixels. |
Declaration
|
dynamic_resize | Determine wether or not the cells are dynamically resized when the Layout size changes. |
Declaration
|
snap_vertical | Allow grips to snap vertically. |
Declaration
|
snap_horizontal | Allow grips to snap horizontally. |
Declaration
|
allow_merge | Allow cells to be merged. |
Declaration
|
allow_split | Allow cells to be splitted. |
Declaration
|
Name | Description |
CanSplit | Helper function to check if a Layout cell can split. |
Declaration bool CanSplit( Widget *cell, SplitterType type, int cut ) Parameters
cell : Reference to the Layout cell to split.
type : Specify the SplitterType which indicate the direction of the split.
cut : Size of the cut in pixels.
Return Value
true if the cell can be cut else return false .
|
SplitCell | Function to split an existing cell in two. |
Declaration Widget *SplitCell( Widget *cell, SplitterType type, int cut ) Parameters
cell : Reference to the Layout cell to split.
type : Specify the SplitterType which indicate the direction of the split.
cut : Size of the cut in pixels.
Return Value
nil if the cell reference provided was invalid; else return the Widget reference to the new cell.
- Note
- When splitting the new cell return will be of the same WidgetType as the input cell.
|
CanMerge | Test if the cell delimited by a specific grip can merge. |
Declaration bool CanMerge( unsigned char grip_index ) Parameters
grip_index : Index of the grip to test if it can be merged.
Return Value
true if the two cell delimited by the grip index can merge; false if the grip index provided was invalid or if the cells cannot be merged.
|
MergeCell | Merge two cell together. |
Declaration bool MergeCell( unsigned char grip_index, MergeDirection direction ) Parameters
grip_index : Index of the grip to merge.
direction : Specify the MergeDirection.
Return Value
true if the two cell delimited by the grip index were able to merge; false if the grip index provided was invalid or if the cell cannot merge.
|
ResizeCells | Resize the cells delimited by a specific grip index. |
Declaration bool ResizeCells( unsigned char grip_index, const ivec2 d ) Parameters
grip_index : Index of the grip to move.
d : Specify the direction of the movement in pixels.
Return Value
true if the grip was able to move and resize the cells; else return false .
|
ResizeCells | Resize the cells delimited by a specific grip index using snapping. |
Declaration bool ResizeCells( unsigned char grip_index, const ivec2 d, bool snap ) Parameters
grip_index : Index of the grip to move.
d : Specify the direction of the movement in pixels.
snap : Optionally snap the cells to the nearest position on the grip grid.
Return Value
true if the grip was able to move and resize the cells; else return false .
|
Resize | Resize the Layout. |
Declaration void Resize( const ivec2 d ) Parameters
d : Specify the amount of pixels to resize.
|
Resize | Resize the Layout using snapping. |
Declaration void Resize( const ivec2 d, bool snap ) Parameters
d : Specify the amount of pixels to resize.
snap : Optionally snap the cells to the nearest position on the grip grid.
|
RebuildLimits | Rebuilt the Layout edges limits to insure proper resizing. |
Declaration void RebuildLimits( void )
|
RebuildGrips | Force to recalculate all grips to insure proper cell resizing. |
Declaration void RebuildGrips( void )
|
Realign | Force to realign all cells contained in the current Layout to insure that they are all snap to their associated grip(s). |
Declaration
|