Kanzi  3.9.6
Kanzi Engine API
kanzi::GridLayoutConcept Class Reference

Base class for the Grid Layout nodes. More...

#include <kanzi/ui/node/concept/grid_layout_concept.hpp>

Inheritance diagram for kanzi::GridLayoutConcept:
[legend]

Classes

struct  RowColumnDefinition
 Definition for the size and position of a single row or column. More...
 

Public Types

enum  GridDirection { GridDirectionRight, GridDirectionDown }
 Direction of layout of grid layout. Items which don't have fixed ColumnProperty and RowProperty are laid out in this direction. More...
 
typedef vector< RowColumnDefinitionRowColumnDefinitionContainer
 Container type for row and column definitions. More...
 
enum  RowColumnSizeMode { RowColumnSizeModeUser, RowColumnSizeModeAuto, RowColumnSizeModeWeighted }
 Size mode for a grid row or a column. More...
 

Static Public Member Functions

static float accumulateMaximumSize (const RowColumnDefinitionContainer &definitions)
 Calculates the sum of row or column definition's maximum sizes. More...
 
static void calculateOffsets (RowColumnDefinitionContainer &definitions)
 Calculates grid row or column definition offsets according to current maximum sizes. More...
 
static void calculateWeightedSizes (RowColumnDefinitionContainer &definitions, float weightMultiplier)
 Calculates grid row or column definition maximum sizes for weighted rows or columns. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
static void parseRowColumnDefinitions (const string &definitionCollection, RowColumnDefinitionContainer &definitions)
 Parse grid row or column definitions from property string. More...
 

Static Public Attributes

Properties
static PropertyType< GridLayoutConcept::GridDirectionDirectionProperty
 Direction property. More...
 
static PropertyType< string > ColumnDefinitionsProperty
 ColumnDefinitions property. More...
 
static PropertyType< string > RowDefinitionsProperty
 RowDefinitions property. More...
 
static PropertyType< int > ColumnProperty
 Column property. More...
 
static PropertyType< int > ColumnSpanProperty
 ColumnSpan property. More...
 
static PropertyType< int > RowProperty
 Row property. More...
 
static PropertyType< int > RowSpanProperty
 RowSpan property. More...
 

Detailed Description

Base class for the Grid Layout nodes.

Grid Layout nodes arrange their items in a grid of cells. The grid node contains the definition for grid: the number and size of rows and columns. The grid items contain the coordinates of their cell, and the number of cells the item spans.

Member Typedef Documentation

◆ RowColumnDefinitionContainer

Container type for row and column definitions.

Member Enumeration Documentation

◆ RowColumnSizeMode

Size mode for a grid row or a column.

Enumerator
RowColumnSizeModeUser 

Row or column size is fixed.

RowColumnSizeModeAuto 

Row or column size is the size of the largest item on this row or column.

RowColumnSizeModeWeighted 

Row or column size is a proportion of the whole grid size. The proportion size depends on the relative weight of the row or column compared to weights of other rows or columns.

◆ GridDirection

Direction of layout of grid layout. Items which don't have fixed ColumnProperty and RowProperty are laid out in this direction.

Enumerator
GridDirectionRight 

Layout first right, then down.

GridDirectionDown 

Layout first down, then right.

Member Function Documentation

◆ makeEditorInfo()

static PropertyTypeEditorInfoSharedPtr kanzi::GridLayoutConcept::makeEditorInfo ( )
static

◆ calculateWeightedSizes()

static void kanzi::GridLayoutConcept::calculateWeightedSizes ( RowColumnDefinitionContainer definitions,
float  weightMultiplier 
)
static

Calculates grid row or column definition maximum sizes for weighted rows or columns.

Parameters
definitionsRow or column definitions.
weightMultiplierThe size of a single weight unit.

◆ calculateOffsets()

static void kanzi::GridLayoutConcept::calculateOffsets ( RowColumnDefinitionContainer definitions)
static

Calculates grid row or column definition offsets according to current maximum sizes.

Parameters
definitionsRow or column definitions.

◆ accumulateMaximumSize()

static float kanzi::GridLayoutConcept::accumulateMaximumSize ( const RowColumnDefinitionContainer definitions)
static

Calculates the sum of row or column definition's maximum sizes.

Parameters
definitionsRow or column definitions.
Returns
Sum of row or column maximum sizes.

◆ parseRowColumnDefinitions()

static void kanzi::GridLayoutConcept::parseRowColumnDefinitions ( const string &  definitionCollection,
RowColumnDefinitionContainer definitions 
)
static

Parse grid row or column definitions from property string.

Parameters
definitionCollectionProperty string describing grid rows or columns. See RowDefinitionsProperty for format definition.
definitionsOutput parameter that will hold the row or column definitions.

Member Data Documentation

◆ DirectionProperty

PropertyType<GridLayoutConcept::GridDirection> kanzi::GridLayoutConcept::DirectionProperty
static

Direction property.

Defines the grid primary layouting direction. This property specifies how to choose the row and column for items without explicit grid row and column properties. The default value is GridLayoutConcept::GridDirectionRight.

See also
setDirection(), getDirection()

◆ ColumnDefinitionsProperty

PropertyType<string> kanzi::GridLayoutConcept::ColumnDefinitionsProperty
static

ColumnDefinitions property.

Defines the columns of the grid. See RowDefinitionsProperty. The default value is "".

See also
setColumnDefinitions(), getColumnDefinitions()

◆ RowDefinitionsProperty

PropertyType<string> kanzi::GridLayoutConcept::RowDefinitionsProperty
static

RowDefinitions property.

Defines the rows of a grid. The string format is "[*f|f];[*f|f];...", where:

  • ';' separates row definitions
  • 'f' signifies a float number
  • '*' signifies a weighted (proportional) height

For example:

  • "1.0;2.0;3.0;" defines three rows with heights of 1.0, 2.0, and 3.0.
  • ";;" defines three rows that all have heights calculated from their content.
  • "*1.0;*2.0;*3.0;" defines three rows where the first row has 1/6 of the total height (Node::HeightProperty), the second 2/6 and the third 3/6. The default value is "".
    See also
    setRowDefinitions(), getRowDefinitions()

◆ ColumnProperty

PropertyType<int> kanzi::GridLayoutConcept::ColumnProperty
static

Column property.

Defines the column of an item in a grid, starting from 0. The default value is 0.

See also
setColumn(), getColumn()

◆ ColumnSpanProperty

PropertyType<int> kanzi::GridLayoutConcept::ColumnSpanProperty
static

ColumnSpan property.

Defines how many columns this grid item spans. The default value is 1.

See also
setColumnSpan(), getColumnSpan()

◆ RowProperty

PropertyType<int> kanzi::GridLayoutConcept::RowProperty
static

Row property.

Defines the row of an item in a grid, starting from 0. The default value is 0.

See also
setRow(), getRow()

◆ RowSpanProperty

PropertyType<int> kanzi::GridLayoutConcept::RowSpanProperty
static

RowSpan property.

Defines how many rows this grid item spans. The default value is 1.

See also
setRowSpan(), getRowSpan()

The documentation for this class was generated from the following file: