GridConceptImplementation is an abstract class for implementing grid concept. More...
#include <kanzi/ui/node/concept/grid_layout_concept.hpp>
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< RowColumnDefinition > | RowColumnDefinitionContainer |
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::GridDirection > | DirectionProperty |
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... | |
GridConceptImplementation is an abstract class for implementing grid concept.
|
protected |
Constructor.
domain | The UI domain the new node belongs to. |
name | The name of the node. |
|
static |
|
static |
Gets the column of an item.
item | A node that is or can become an item of a grid. |
|
static |
Sets the column of an item.
item | A node that is or can become an item of a grid. |
column | Column of the item. |
|
static |
Gets the column span of an item.
item | A node that is or can become an item of a grid. |
|
static |
Sets the column span of an item.
item | A node that is or can become an item of a grid. |
columnSpan | Column span of the item. |
|
static |
Gets the row of an item.
item | A node that is or can become an item of a grid. |
|
static |
Sets the row of an item.
item | A node that is or can become an item of a grid. |
row | Row of the item. |
|
static |
Gets the row span of an item.
item | A node that is or can become an item of a grid. |
|
static |
Sets the row span of an item.
item | A node that is or can become an item of a grid. |
rowSpan | Row span of the item. |
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRowCount | ( | ) | const |
Gets the number of rows in the grid.
unsigned int kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumnCount | ( | ) | const |
Gets the number of columns in the grid.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addFixedRow | ( | float | size | ) |
Adds a new fixed size row to the grid.
size | Size of the row. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addAutomaticRow | ( | ) |
Adds a new automatic size row to the grid.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addWeightedRow | ( | float | weight | ) |
Adds a new weighted size row to the grid.
weight | Weight of the row. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addFixedColumn | ( | float | size | ) |
Adds a new fixed size column to the grid.
size | Size of the column. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addAutomaticColumn | ( | ) |
Adds a new automatic size column to the grid.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::addWeightedColumn | ( | float | weight | ) |
Adds a new weighted size column to the grid.
weight | Weight of the column. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::removeRow | ( | ) |
Removes the last row from the grid.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::removeColumn | ( | ) |
Removes the last column from the grid.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowFixed | ( | unsigned int | index, |
float | size | ||
) |
Sets a grid row to a fixed size.
index | Index of the row, starting from 0. |
size | Size of the row. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowAutomatic | ( | unsigned int | index | ) |
Sets a grid row to automatic size.
index | Index of the row, starting from 0. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowWeighted | ( | unsigned int | index, |
float | weight | ||
) |
Sets a grid row to a weighted size.
index | Index of the row, starting from 0. |
weight | Weight of the row. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnFixed | ( | unsigned int | index, |
float | size | ||
) |
Sets a grid column to a fixed size.
index | Index of the column, starting from 0. |
size | Size of the column. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnAutomatic | ( | unsigned int | index | ) |
Sets a grid column to automatic size.
index | Index of the row, starting from 0. |
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnWeighted | ( | unsigned int | index, |
float | weight | ||
) |
Sets a grid column to a weighted size.
index | Index of the column, starting from 0. |
weight | Weight of the column. |
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.
index | Index of the row, starting from 0. |
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.
index | Index of the column, starting from 0. |
GridLayoutConcept::GridDirection kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getDirection | ( | ) | const |
Gets the Direction property.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setDirection | ( | GridLayoutConcept::GridDirection | value | ) |
Sets the Direction property.
string kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getColumnDefinitions | ( | ) | const |
Gets the ColumnDefinitions property.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setColumnDefinitions | ( | string_view | value | ) |
Sets the ColumnDefinitions property.
string kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::getRowDefinitions | ( | ) | const |
Gets the RowDefinitions property.
void kanzi::GridLayoutConceptImpl< TBaseClass, TDerivedClass >::setRowDefinitions | ( | string_view | value | ) |
Sets the RowDefinitions property.
|
overrideprotected |
TBaseClass::arrangeOverride() implementation.
|
staticprotected |
Decides the row and column for the next item in the grid.
Requires a workspace to store state between calls.
node | Next item to position. |
workspace | Stores state from previous calls to this function. Updated during the call. |
out_row | Row of the item. |
out_column | Column of the item. |
|
staticprotected |
Gets the span of a grid item.
|
protected |
Row definitions.
|
protected |
Column definitions.
|
protected |
Total weights of weighted rows.
|
protected |
Total weight of weighted columns.
|
protected |
Total size of all rows.
|
protected |
Total size of all columns.