|
Kanzi Graphics Engine
|
User interface grid layout component. More...
#include <user/scene_graph/kzu_object.h>#include <user/ui/kzu_layout.h>#include <system/kzs_types.h>#include <system/debug/kzs_error.h>#include <system/kzs_header.h>Functions | |
| kzsError | kzuUiGridLayoutCreate (const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, struct KzuUiGridLayout **out_uiGridLayout) |
| Creates a grid layout with default settings. More... | |
| kzsError | kzuUiGridLayoutRegisterToFactory (const struct KzuFactory *factory) |
| Registers component type to factory. More... | |
| struct KzuUiComponentNode * | kzuUiGridLayoutToUiComponentNode (const struct KzuUiGridLayout *gridLayout) |
| Casts from KzuUiGridLayout to KzuUiComponentNode. More... | |
| struct KzuUiGridLayout * | kzuUiGridLayoutFromUiComponentNode (const struct KzuUiComponentNode *component) |
| Casts from KzuUiComponentNode to KzuUiGridLayout. More... | |
| kzUint | kzuUiGridLayoutGetRowCount (const struct KzuUiGridLayout *gridLayout) |
| Get the number of rows. More... | |
| kzUint | kzuUiGridLayoutGetColumnCount (const struct KzuUiGridLayout *gridLayout) |
| Get the number of columns. More... | |
| enum KzuUiGridLayoutDirection | kzuUiGridLayoutGetLayoutDirection (const struct KzuUiGridLayout *layout) |
| Get primary layout direction of grid layout. More... | |
| kzsError | kzuUiGridLayoutAddRow (const struct KzuUiGridLayout *gridLayout, enum KzuUiGridLayoutSizeMode sizeMode, kzFloat size) |
| Add a row at the end of the grid. More... | |
| kzsError | kzuUiGridLayoutAddColumn (const struct KzuUiGridLayout *gridLayout, enum KzuUiGridLayoutSizeMode sizeMode, kzFloat size) |
| Add a column at the end of the grid. More... | |
| kzsError | kzuUiGridLayoutRemoveRow (const struct KzuUiGridLayout *gridLayout) |
| Removes the row at the end of the grid. More... | |
| kzsError | kzuUiGridLayoutRemoveColumn (const struct KzuUiGridLayout *gridLayout) |
| Removes the column at the end of the grid. More... | |
| kzsError | kzuUiGridLayoutResizeRow (const struct KzuUiGridLayout *gridLayout, kzUint index, enum KzuUiGridLayoutSizeMode sizeMode, kzFloat size) |
| Resizes the row with the given index. More... | |
| kzsError | kzuUiGridLayoutResizeColumn (const struct KzuUiGridLayout *gridLayout, kzUint index, enum KzuUiGridLayoutSizeMode sizeMode, kzFloat size) |
| Resizes the column with the given index. More... | |
| kzFloat | kzuUiGridLayoutGetActualRowSize (const struct KzuUiGridLayout *gridLayout, kzUint rowIndex) |
| Get the calculated size of a row. More... | |
| kzFloat | kzuUiGridLayoutGetActualColumnSize (const struct KzuUiGridLayout *gridLayout, kzUint columnIndex) |
| Get the calculated size of a column. More... | |
Variables | |
| const KzuObjectType | KZU_OBJECT_TYPE_UI_GRID_LAYOUT |
| Object type for Grid Layout. More... | |
User interface grid layout component.
KzuUiGridLayout lays out its children in a grid which size is specified by KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW_DEFINITIONS and KZU_PROPERTY_TYPE_GRID_LAYOUT_COLUMN_DEFINITIONS properties. If these properties are missing, the grid does not have any cells. The cell of a child can be fixed by KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW and KZU_PROPERTY_TYPE_GRID_LAYOUT_COLUMN integer properties defined in the child (0 is the first row or column). If a child does not have both of these properties, the next free cell is used.
KzuUiGridLayout does not send or receive any messages.
KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW_DEFINITIONS string property defines the rows of the grid. The string has a special format of "[\*f|f];[\*f|f]..." where each row definition is separated by a ';' character, 'f' signifies a float number and '*' signifies a weighed (proportional) height. For example, "1.0;2.0;3.0" defines three rows with heights of 1.0, 2.0 and 3.0 respectively. ";;" specifies three rows that all have heights calculated from their content. "*1.0;*2.0;*3.0" specifies three rows where the first row has 1/6 of the total height (KZU_PROPERTY_TYPE_LAYOUT_HEIGHT), the second 2/6 and the third 3/6.
KZU_PROPERTY_TYPE_GRID_LAYOUT_COLUMN_DEFINITIONS string property defines the columns of the grid. The same string format as for KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW_DEFINITIONS is used but for column widths.
KZU_PROPERTY_TYPE_GRID_LAYOUT_DIRECTION integer property defines the primary layouting direction. Its valid values are KZU_GRID_LAYOUT_DIRECTION_RIGHT and KZU_GRID_LAYOUT_DIRECTION_DOWN. This property specifies whether KzuUiGridLayout lays out its children first left to right and then top to bottom (KZU_GRID_LAYOUT_DIRECTION_RIGHT), or first top to bottom and then left to right (KZU_GRID_LAYOUT_DIRECTION_DOWN). The default value is KZU_GRID_LAYOUT_DIRECTION_RIGHT.
KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW integer property can be set in a child of the grid layout. Its value is the number of the row where the child should be placed, starting from 0.
KZU_PROPERTY_TYPE_GRID_LAYOUT_COLUMN integer property can be set in a child of the grid layout. Its value is the number of the column where the child should be placed, starting from 0.
KZU_PROPERTY_TYPE_GRID_LAYOUT_ROW_SPAN integer property can be set in a child of the grid layout. Its value is the number of rows the child should occupy in the grid. Notice that this value cannot be larger than the remaining number of rows.
KZU_PROPERTY_TYPE_GRID_LAYOUT_COLUMN_SPAN integer property can be set in a child of the grid layout. Its value is the number of columns the child should occupy in the grid. Notice that this value cannot be larger than the remaining number of columns.
KZU_PROPERTY_TYPE_LAYOUT_WIDTH float property specifies the size of the grid in X-axis direction.
KZU_PROPERTY_TYPE_LAYOUT_HEIGHT float property specifies the size of the grid in Y-axis direction.
KZU_PROPERTY_TYPE_LAYOUT_DEPTH float property specifies the size of the grid in Z-axis direction.
Copyright 2008-2019 by Rightware. All rights reserved.
| kzsError kzuUiGridLayoutCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| kzString | name, | ||
| struct KzuUIDomain * | uiDomain, | ||
| struct KzuUiGridLayout ** | out_uiGridLayout | ||
| ) |
Creates a grid layout with default settings.
| memoryManager | The memory manager to use for memory allocations. |
| name | Name of the grid layout. |
| uiDomain | The UI domain to use. |
| out_uiGridLayout | Pointer that is set to point to the new grid layout. |
| kzsError kzuUiGridLayoutRegisterToFactory | ( | const struct KzuFactory * | factory) |
Registers component type to factory.
| struct KzuUiComponentNode* kzuUiGridLayoutToUiComponentNode | ( | const struct KzuUiGridLayout * | gridLayout) |
Casts from KzuUiGridLayout to KzuUiComponentNode.
| struct KzuUiGridLayout* kzuUiGridLayoutFromUiComponentNode | ( | const struct KzuUiComponentNode * | component) |
Casts from KzuUiComponentNode to KzuUiGridLayout.
| kzUint kzuUiGridLayoutGetRowCount | ( | const struct KzuUiGridLayout * | gridLayout) |
Get the number of rows.
| kzUint kzuUiGridLayoutGetColumnCount | ( | const struct KzuUiGridLayout * | gridLayout) |
Get the number of columns.
| enum KzuUiGridLayoutDirection kzuUiGridLayoutGetLayoutDirection | ( | const struct KzuUiGridLayout * | layout) |
Get primary layout direction of grid layout.
| kzsError kzuUiGridLayoutAddRow | ( | const struct KzuUiGridLayout * | gridLayout, |
| enum KzuUiGridLayoutSizeMode | sizeMode, | ||
| kzFloat | size | ||
| ) |
Add a row at the end of the grid.
| kzsError kzuUiGridLayoutAddColumn | ( | const struct KzuUiGridLayout * | gridLayout, |
| enum KzuUiGridLayoutSizeMode | sizeMode, | ||
| kzFloat | size | ||
| ) |
Add a column at the end of the grid.
| kzsError kzuUiGridLayoutRemoveRow | ( | const struct KzuUiGridLayout * | gridLayout) |
Removes the row at the end of the grid.
| kzsError kzuUiGridLayoutRemoveColumn | ( | const struct KzuUiGridLayout * | gridLayout) |
Removes the column at the end of the grid.
| kzsError kzuUiGridLayoutResizeRow | ( | const struct KzuUiGridLayout * | gridLayout, |
| kzUint | index, | ||
| enum KzuUiGridLayoutSizeMode | sizeMode, | ||
| kzFloat | size | ||
| ) |
Resizes the row with the given index.
| gridLayout | The grid layout. |
| index | Index of the row to resize. If this is too big, the function can crash. |
| sizeMode | KzuUiGridLayoutSizeMode value specifying meaning of the size argument. |
| size | Height of the row. This number is ignored if sizeMode is KZU_UI_GRID_LAYOUT_SIZE_AUTO. |
| kzsError kzuUiGridLayoutResizeColumn | ( | const struct KzuUiGridLayout * | gridLayout, |
| kzUint | index, | ||
| enum KzuUiGridLayoutSizeMode | sizeMode, | ||
| kzFloat | size | ||
| ) |
Resizes the column with the given index.
| gridLayout | The grid layout. |
| index | Index of the column to resize. If this is too big, the function can crash. |
| sizeMode | KzuUiGridLayoutSizeMode value specifying meaning of the size argument. |
| size | Width of the column. This number is ignored if sizeMode is KZU_UI_GRID_LAYOUT_SIZE_AUTO. |
| kzFloat kzuUiGridLayoutGetActualRowSize | ( | const struct KzuUiGridLayout * | gridLayout, |
| kzUint | rowIndex | ||
| ) |
Get the calculated size of a row.
| gridLayout | The grid layout. |
| index | Index of the row. If this is too big, the function can crash. |
| kzFloat kzuUiGridLayoutGetActualColumnSize | ( | const struct KzuUiGridLayout * | gridLayout, |
| kzUint | columnIndex | ||
| ) |
Get the calculated size of a column.
| gridLayout | The grid layout. |
| index | Index of the column. If this is too big, the function can crash. |
| const KzuObjectType KZU_OBJECT_TYPE_UI_GRID_LAYOUT |
Object type for Grid Layout.