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

Static Public Member Functions

static unsigned int getColumn (const Node &item)
 Gets the column of an item.
 
static unsigned int getColumnSpan (const Node &item)
 Gets the column span of an item.
 
static unsigned int getRow (const Node &item)
 Gets the row of an item.
 
static unsigned int getRowSpan (const Node &item)
 Gets the row span of an item.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
static void setColumn (Node &item, unsigned int column)
 Sets the column of an item.
 
static void setColumnSpan (Node &item, unsigned int columnSpan)
 Sets the column span of an item.
 
static void setRow (Node &item, unsigned int row)
 Sets the row of an item.
 
static void setRowSpan (Node &item, unsigned int rowSpan)
 Sets the row span of an item.
 
- 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.
 
static void calculateOffsets (RowColumnDefinitionContainer &definitions)
 Calculates grid row or column definition offsets according to current maximum sizes.
 
static void calculateWeightedSizes (RowColumnDefinitionContainer &definitions, float weightMultiplier)
 Calculates grid row or column definition maximum sizes for weighted rows or columns.
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 
static void parseRowColumnDefinitions (const string &definitionCollection, RowColumnDefinitionContainer &definitions)
 Parse grid row or column definitions from property string.
 

Protected Member Functions

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

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.
 
static void getSpan (const Node &item, unsigned int &rowSpan, unsigned int &columnSpan)
 Gets the span of a grid item.
 

Protected Attributes

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

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.
 
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.
 
static PropertyType< string > ColumnDefinitionsProperty
 ColumnDefinitions property.
 
static PropertyType< string > RowDefinitionsProperty
 RowDefinitions property.
 
static PropertyType< intColumnProperty
 Column property.
 
static PropertyType< intColumnSpanProperty
 ColumnSpan property.
 
static PropertyType< intRowProperty
 Row property.
 
static PropertyType< intRowSpanProperty
 RowSpan property.
 

Detailed Description

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

Implementation class for GridLayoutConcept.

Constructor & Destructor Documentation

◆ GridLayoutConceptImpl()

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

◆ makeEditorInfo()

template<typename TBaseClass , typename TDerivedClass >
PropertyTypeEditorInfoSharedPtr kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::makeEditorInfo ( )
static

◆ getColumn()

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.

◆ setColumn()

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.

◆ getColumnSpan()

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.

◆ setColumnSpan()

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.

◆ getRow()

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.

◆ setRow()

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.

◆ getRowSpan()

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.

◆ setRowSpan()

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.

◆ getRowCount()

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.

◆ getColumnCount()

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.

◆ addFixedRow()

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.

◆ addAutomaticRow()

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

Adds a new automatic size row to the grid.

◆ addWeightedRow()

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.

◆ addFixedColumn()

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.

◆ addAutomaticColumn()

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

Adds a new automatic size column to the grid.

◆ addWeightedColumn()

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.

◆ removeRow()

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

Removes the last row from the grid.

◆ removeColumn()

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

Removes the last column from the grid.

◆ setRowFixed()

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.

◆ setRowAutomatic()

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.

◆ setRowWeighted()

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.

◆ setColumnFixed()

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.

◆ setColumnAutomatic()

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.

◆ setColumnWeighted()

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.

◆ getActualRowSize()

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.

◆ getActualColumnSize()

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.

◆ getDirection()

template<typename TBaseClass , typename TDerivedClass >
GridLayoutConcept::GridDirection kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getDirection ( ) const

Gets the Direction property.

◆ setDirection()

Sets the Direction property.

◆ getColumnDefinitions()

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

Gets the ColumnDefinitions property.

◆ setColumnDefinitions()

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

Sets the ColumnDefinitions property.

◆ getRowDefinitions()

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

Gets the RowDefinitions property.

◆ setRowDefinitions()

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

Sets the RowDefinitions property.

◆ onNodePropertyChanged()

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

TBaseClass::arrangeOverride() implementation.

◆ getNextItemLocation()

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.

◆ getSpan()

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

◆ m_rows

Row definitions.

◆ m_columns

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

Column definitions.

◆ m_rowWeights

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

Total weights of weighted rows.

◆ m_columnWeights

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

Total weight of weighted columns.

◆ m_accumulatedRowSize

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

Total size of all rows.

◆ m_accumulatedColumnSize

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: