Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass > Class Template Reference

Implementation class for GridLayoutConcept. More...

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

Inheritance diagram for kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >:
[legend]

Classes

struct  GridObjectLocationWorkspace
 Information used to store the state between function calls when locating objects. More...
 

Public Member Functions

void addAutomaticColumn ()
 Adds a new automatic size column to the grid. More...
 
void addAutomaticRow ()
 Adds a new automatic size row to the grid. More...
 
void addFixedColumn (float size)
 Adds a new fixed size column to the grid. More...
 
void addFixedRow (float size)
 Adds a new fixed size row to the grid. More...
 
void addWeightedColumn (float weight)
 Adds a new weighted size column to the grid. More...
 
void addWeightedRow (float weight)
 Adds a new weighted size row to the grid. More...
 
float getActualColumnSize (unsigned int index) const
 Gets the last calculated value for a grid column size. More...
 
float getActualRowSize (unsigned int index) const
 Gets the last calculated value for a grid row size. More...
 
unsigned int getColumnCount () const
 Gets the number of columns in the grid. More...
 
string getColumnDefinitions () const
 Gets the ColumnDefinitions property. More...
 
GridDirection getDirection () const
 Gets the Direction property. More...
 
unsigned int getRowCount () const
 Gets the number of rows in the grid. More...
 
string getRowDefinitions () const
 Gets the RowDefinitions property. More...
 
void removeColumn ()
 Removes the last column from the grid. More...
 
void removeRow ()
 Removes the last row from the grid. More...
 
void setColumnAutomatic (unsigned int index)
 Sets a grid column to automatic size. More...
 
void setColumnDefinitions (string_view value)
 Sets the ColumnDefinitions property. More...
 
void setColumnFixed (unsigned int index, float size)
 Sets a grid column to a fixed size. More...
 
void setColumnWeighted (unsigned int index, float weight)
 Sets a grid column to a weighted size. More...
 
void setDirection (GridDirection value)
 Sets the Direction property. More...
 
void setRowAutomatic (unsigned int index)
 Sets a grid row to automatic size. More...
 
void setRowDefinitions (string_view value)
 Sets the RowDefinitions property. More...
 
void setRowFixed (unsigned int index, float size)
 Sets a grid row to a fixed size. More...
 
void setRowWeighted (unsigned int index, float weight)
 Sets a grid row to a weighted size. More...
 

Static Public Member Functions

static unsigned int getColumn (const Node &item)
 Gets the column of an item. More...
 
static unsigned int getColumnSpan (const Node &item)
 Gets the column span of an item. More...
 
static unsigned int getRow (const Node &item)
 Gets the row of an item. More...
 
static unsigned int getRowSpan (const Node &item)
 Gets the row span of an item. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
static void setColumn (Node &item, unsigned int column)
 Sets the column of an item. More...
 
static void setColumnSpan (Node &item, unsigned int columnSpan)
 Sets the column span of an item. More...
 
static void setRow (Node &item, unsigned int row)
 Sets the row of an item. More...
 
static void setRowSpan (Node &item, unsigned int rowSpan)
 Sets the row span of an item. More...
 
- Static Public Member Functions inherited from kanzi::GridLayoutConcept
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...
 

Protected Member Functions

 GridLayoutConceptImpl (Domain *domain, string_view name)
 Constructor. More...
 
void onNodePropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) override
 TBaseClass::arrangeOverride() implementation. More...
 

Static Protected Member Functions

static void getNextItemLocation (const Node &node, GridObjectLocationWorkspace &workspace, unsigned int &out_row, unsigned int &out_column)
 Decides the row and column for the next item in the grid. More...
 
static void getSpan (const Node &item, unsigned int &rowSpan, unsigned int &columnSpan)
 Gets the span of a grid item. More...
 

Protected Attributes

float m_accumulatedColumnSize
 Total size of all columns. More...
 
float m_accumulatedRowSize
 Total size of all rows. More...
 
RowColumnDefinitionContainer m_columns
 Column definitions. More...
 
float m_columnWeights
 Total weight of weighted columns. More...
 
RowColumnDefinitionContainer m_rows
 Row definitions. More...
 
float m_rowWeights
 Total weights of weighted rows. More...
 

Additional Inherited Members

- Public Types inherited from kanzi::GridLayoutConcept
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 Attributes inherited from kanzi::GridLayoutConcept
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

template<typename TBaseClass, typename TDerivedClass>
class kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >

Implementation class for GridLayoutConcept.

Constructor & Destructor Documentation

template<typename TBaseClass , typename TDerivedClass >
kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::GridLayoutConceptImpl ( Domain domain,
string_view  name 
)
protected

Constructor.

Parameters
domainThe UI domain the new node belongs to.
nameThe name of the node.

Member Function Documentation

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumn ( const Node item)
static

Gets the column of an item.

Parameters
itemA node that is or can become an item of a grid.
Returns
Returns the value of the column property.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumn ( Node item,
unsigned int  column 
)
static

Sets the column of an item.

Parameters
itemA node that is or can become an item of a grid.
columnColumn of the item.
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumnSpan ( const Node item)
static

Gets the column span of an item.

Parameters
itemA node that is or can become an item of a grid.
Returns
Returns the value of the column span property.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnSpan ( Node item,
unsigned int  columnSpan 
)
static

Sets the column span of an item.

Parameters
itemA node that is or can become an item of a grid.
columnSpanColumn span of the item.
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRow ( const Node item)
static

Gets the row of an item.

Parameters
itemA node that is or can become an item of a grid.
Returns
Returns the value of the row property.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRow ( Node item,
unsigned int  row 
)
static

Sets the row of an item.

Parameters
itemA node that is or can become an item of a grid.
rowRow of the item.
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRowSpan ( const Node item)
static

Gets the row span of an item.

Parameters
itemA node that is or can become an item of a grid.
Returns
Returns the value of the row span property.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowSpan ( Node item,
unsigned int  rowSpan 
)
static

Sets the row span of an item.

Parameters
itemA node that is or can become an item of a grid.
rowSpanRow span of the item.
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRowCount ( ) const

Gets the number of rows in the grid.

Returns
The number of rows in the grid.
template<typename TBaseClass , typename TDerivedClass >
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumnCount ( ) const

Gets the number of columns in the grid.

Returns
The number of columns in the grid.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addFixedRow ( float  size)

Adds a new fixed size row to the grid.

Parameters
sizeSize of the row.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addAutomaticRow ( )

Adds a new automatic size row to the grid.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addWeightedRow ( float  weight)

Adds a new weighted size row to the grid.

Parameters
weightWeight of the row.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addFixedColumn ( float  size)

Adds a new fixed size column to the grid.

Parameters
sizeSize of the column.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addAutomaticColumn ( )

Adds a new automatic size column to the grid.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addWeightedColumn ( float  weight)

Adds a new weighted size column to the grid.

Parameters
weightWeight of the column.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::removeRow ( )

Removes the last row from the grid.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::removeColumn ( )

Removes the last column from the grid.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowFixed ( unsigned int  index,
float  size 
)

Sets a grid row to a fixed size.

Parameters
indexIndex of the row, starting from 0.
sizeSize of the row.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowAutomatic ( unsigned int  index)

Sets a grid row to automatic size.

Parameters
indexIndex of the row, starting from 0.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowWeighted ( unsigned int  index,
float  weight 
)

Sets a grid row to a weighted size.

Parameters
indexIndex of the row, starting from 0.
weightWeight of the row.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnFixed ( unsigned int  index,
float  size 
)

Sets a grid column to a fixed size.

Parameters
indexIndex of the column, starting from 0.
sizeSize of the column.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnAutomatic ( unsigned int  index)

Sets a grid column to automatic size.

Parameters
indexIndex of the row, starting from 0.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnWeighted ( unsigned int  index,
float  weight 
)

Sets a grid column to a weighted size.

Parameters
indexIndex of the column, starting from 0.
weightWeight of the column.
template<typename TBaseClass , typename TDerivedClass >
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getActualRowSize ( unsigned int  index) const

Gets the last calculated value for a grid row size.

The value is recalculated whenever the grid is layouted.

Parameters
indexIndex of the row, starting from 0.
template<typename TBaseClass , typename TDerivedClass >
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getActualColumnSize ( unsigned int  index) const

Gets the last calculated value for a grid column size.

The value is recalculated whenever the grid is layouted.

Parameters
indexIndex of the column, starting from 0.
template<typename TBaseClass , typename TDerivedClass >
GridLayoutConcept::GridDirection kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getDirection ( ) const

Gets the Direction property.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setDirection ( GridLayoutConcept::GridDirection  value)

Sets the Direction property.

template<typename TBaseClass , typename TDerivedClass >
string kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumnDefinitions ( ) const

Gets the ColumnDefinitions property.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnDefinitions ( string_view  value)

Sets the ColumnDefinitions property.

template<typename TBaseClass , typename TDerivedClass >
string kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRowDefinitions ( ) const

Gets the RowDefinitions property.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowDefinitions ( string_view  value)

Sets the RowDefinitions property.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::onNodePropertyChanged ( AbstractPropertyType  propertyType,
PropertyNotificationReason  reason 
)
overrideprotected

TBaseClass::arrangeOverride() implementation.

template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getNextItemLocation ( const Node node,
GridObjectLocationWorkspace workspace,
unsigned int &  out_row,
unsigned int &  out_column 
)
staticprotected

Decides the row and column for the next item in the grid.

Requires a workspace to store state between calls.

Parameters
nodeNext item to position.
workspaceStores state from previous calls to this function. Updated during the call.
out_rowRow of the item.
out_columnColumn of the item.
template<typename TBaseClass , typename TDerivedClass >
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getSpan ( const Node item,
unsigned int &  rowSpan,
unsigned int &  columnSpan 
)
staticprotected

Gets the span of a grid item.

Member Data Documentation

template<typename TBaseClass, typename TDerivedClass>
RowColumnDefinitionContainer kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_rows
protected

Row definitions.

template<typename TBaseClass, typename TDerivedClass>
RowColumnDefinitionContainer kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_columns
protected

Column definitions.

template<typename TBaseClass, typename TDerivedClass>
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_rowWeights
protected

Total weights of weighted rows.

template<typename TBaseClass, typename TDerivedClass>
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_columnWeights
protected

Total weight of weighted columns.

template<typename TBaseClass, typename TDerivedClass>
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_accumulatedRowSize
protected

Total size of all rows.

template<typename TBaseClass, typename TDerivedClass>
float kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::m_accumulatedColumnSize
protected

Total size of all columns.


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