Tizen Native API
5.5
|
TableView is a layout container for aligning child actors in a grid like layout. More...
Classes | |
struct | CellPosition |
Structure to specify layout position for child actor. More... | |
struct | ChildProperty |
Enumeration for the instance of child properties belonging to the TableView class. More... | |
struct | Property |
Enumeration for the instance of properties belonging to the TableView class. More... | |
Public Types | |
enum | PropertyRange |
Enumeration for the start and end property ranges for this control. More... | |
enum | LayoutPolicy |
Enumeration for describing how the size of a row / column has been set. More... | |
Public Member Functions | |
TableView () | |
Creates a TableView handle; this can be initialized with TableView::New(). Calling member functions with an uninitialized handle is not allowed. | |
TableView (const TableView &handle) | |
Copy constructor. Creates another handle that points to the same real object. | |
TableView & | operator= (const TableView &handle) |
Assignment operator. Changes this handle to point to another real object. | |
~TableView () | |
Destructor. | |
bool | AddChild (Actor child, CellPosition position) |
Adds a child to the table. If the row or column index is outside the table, the table gets resized bigger. | |
Actor | GetChildAt (CellPosition position) |
Returns a child from the given layout position. | |
Actor | RemoveChildAt (CellPosition position) |
Removes a child from the given layout position. | |
bool | FindChildPosition (Actor child, CellPosition &position) |
Finds the child's layout position. | |
void | InsertRow (unsigned int rowIndex) |
Inserts a new row to given index. | |
void | DeleteRow (unsigned int rowIndex) |
Deletes a row from the given index. Removed elements are deleted. | |
void | DeleteRow (unsigned int rowIndex, std::vector< Actor > &removed) |
Deletes a row from the given index. | |
void | InsertColumn (unsigned int columnIndex) |
Inserts a new column to the given index. | |
void | DeleteColumn (unsigned int columnIndex) |
Deletes a column from the given index. Removed elements are deleted. | |
void | DeleteColumn (unsigned int columnIndex, std::vector< Actor > &removed) |
Deletes a column from the given index. | |
void | Resize (unsigned int rows, unsigned int columns) |
Resizes the TableView. | |
void | Resize (unsigned int rows, unsigned int columns, std::vector< Actor > &removed) |
Resizes the TableView. | |
void | SetCellPadding (Size padding) |
Sets horizontal and vertical padding between cells. | |
Size | GetCellPadding () |
Gets the current padding as width and height. | |
void | SetFitHeight (unsigned int rowIndex) |
Specifies this row as fitting its height to its children. | |
bool | IsFitHeight (unsigned int rowIndex) const |
Checks if the row is a fit row. | |
void | SetFitWidth (unsigned int columnIndex) |
Specifies this column as fitting its width to its children. | |
bool | IsFitWidth (unsigned int columnIndex) const |
Checks if the column is a fit column. | |
void | SetFixedHeight (unsigned int rowIndex, float height) |
Sets a row to have fixed height. Setting a fixed height of 0 has no effect. | |
float | GetFixedHeight (unsigned int rowIndex) const |
Gets a row's fixed height. | |
void | SetRelativeHeight (unsigned int rowIndex, float heightPercentage) |
Sets a row to have relative height. Relative height means percentage of the remainder of the table height after subtracting Padding and Fixed height rows. Setting a relative height of 0 has no effect. | |
float | GetRelativeHeight (unsigned int rowIndex) const |
Gets a row's relative height. | |
void | SetFixedWidth (unsigned int columnIndex, float width) |
Sets a column to have fixed width. Setting a fixed width of 0 has no effect. | |
float | GetFixedWidth (unsigned int columnIndex) const |
Gets a column's fixed width. | |
void | SetRelativeWidth (unsigned int columnIndex, float widthPercentage) |
Sets a column to have relative width. Relative width means percentage of the remainder of table width after subtracting Padding and Fixed width columns. Setting a relative width of 0 has no effect. | |
float | GetRelativeWidth (unsigned int columnIndex) const |
Gets a column's relative width. | |
unsigned int | GetRows () |
Gets the amount of rows in the table. | |
unsigned int | GetColumns () |
Gets the amount of columns in the table. | |
void | SetCellAlignment (CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical) |
Sets the alignment on a cell. | |
Static Public Member Functions | |
static TableView | New (unsigned int initialRows, unsigned int initialColumns) |
Creates the TableView control. | |
static TableView | DownCast (BaseHandle handle) |
Downcasts a handle to TableView handle. |
TableView is a layout container for aligning child actors in a grid like layout.
TableView constrains the x and y position and width and height of the child actors. z position and depth are left intact so that 3D model actors can also be laid out in a grid without loosing their depth scaling.
When an actor is add to the tableView through Actor::Add() instead of TableView::AddChild, the following custom properties of the actor are checked to decide the actor position inside the table.
These properties are registered dynamically to the child and is non-animatable.
| Property Name | Type | |-------------------------|-------------| | cellIndex | Vector2 | | rowSpan | float | | columnSpan | float | | cellHorizontalAlignment | string | | cellVerticalAlignment | string |
The rowSpan or columnSpan has integer value, but its type is float here due to the limitation of the builder's ability to differentiate integer and float from Json string. The available values for cellHorizontalAlignment are: left, center, right. The available values for cellVerticalAlignment are: top, center, bottom.
"name":"gallery1", "type":"ImageView", "image": { "url": "{DALI_IMAGE_DIR}gallery-small-1.jpg" }, "properties": { "cellIndex":[1,1], // Property to specify the top-left cell this child occupies, if not set, the first available cell is used "rowSpan":3, // Property to specify how many rows this child occupies, if not set, default value is 1 "columnSpan": 2, // Property to specify how many columns this child occupies, if nor set, default value is 1 "cellHorizontalAlignment": "left", // Property to specify how to align horizontally inside the cells, if not set, default value is 'left' "cellVerticalAlignment": "center" // Property to specify how to align vertically inside the cells, if not set, default value is 'top' }
Enumeration for describing how the size of a row / column has been set.
Enumeration for the start and end property ranges for this control.
Reimplemented from Dali::Toolkit::Control.
Creates a TableView handle; this can be initialized with TableView::New(). Calling member functions with an uninitialized handle is not allowed.
Dali::Toolkit::TableView::TableView | ( | const TableView & | handle | ) |
Copy constructor. Creates another handle that points to the same real object.
[in] | handle | Handle to copy from |
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
bool Dali::Toolkit::TableView::AddChild | ( | Actor | child, |
CellPosition | position | ||
) |
Adds a child to the table. If the row or column index is outside the table, the table gets resized bigger.
[in] | child | The child to add |
[in] | position | The position for the child |
true
if the addition succeeded, false
if the cell is already occupied void Dali::Toolkit::TableView::DeleteColumn | ( | unsigned int | columnIndex | ) |
Deletes a column from the given index. Removed elements are deleted.
[in] | columnIndex | The columnIndex of the column to delete |
void Dali::Toolkit::TableView::DeleteColumn | ( | unsigned int | columnIndex, |
std::vector< Actor > & | removed | ||
) |
Deletes a column from the given index.
[in] | columnIndex | The columnIndex of the column to delete |
[out] | removed | The removed elements |
void Dali::Toolkit::TableView::DeleteRow | ( | unsigned int | rowIndex | ) |
Deletes a row from the given index. Removed elements are deleted.
[in] | rowIndex | The rowIndex of the row to delete |
void Dali::Toolkit::TableView::DeleteRow | ( | unsigned int | rowIndex, |
std::vector< Actor > & | removed | ||
) |
Deletes a row from the given index.
[in] | rowIndex | The rowIndex of the row to delete |
[out] | removed | The removed elements |
static TableView Dali::Toolkit::TableView::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to TableView handle.
If handle points to a TableView, the downcast produces valid handle. If not, the returned handle is left uninitialized.
[in] | handle | Handle to an object |
Reimplemented from Dali::Toolkit::Control.
bool Dali::Toolkit::TableView::FindChildPosition | ( | Actor | child, |
CellPosition & | position | ||
) |
Finds the child's layout position.
[in] | child | The child to search for |
[out] | position | The position for the child |
Gets the current padding as width and height.
Actor Dali::Toolkit::TableView::GetChildAt | ( | CellPosition | position | ) |
Returns a child from the given layout position.
[in] | position | The position in the table |
unsigned int Dali::Toolkit::TableView::GetColumns | ( | ) |
Gets the amount of columns in the table.
float Dali::Toolkit::TableView::GetFixedHeight | ( | unsigned int | rowIndex | ) | const |
Gets a row's fixed height.
[in] | rowIndex | The row index with fixed height |
float Dali::Toolkit::TableView::GetFixedWidth | ( | unsigned int | columnIndex | ) | const |
Gets a column's fixed width.
[in] | columnIndex | The column index with fixed width |
float Dali::Toolkit::TableView::GetRelativeHeight | ( | unsigned int | rowIndex | ) | const |
Gets a row's relative height.
[in] | rowIndex | The row index with relative height |
float Dali::Toolkit::TableView::GetRelativeWidth | ( | unsigned int | columnIndex | ) | const |
Gets a column's relative width.
[in] | columnIndex | The column index with relative width |
unsigned int Dali::Toolkit::TableView::GetRows | ( | ) |
Gets the amount of rows in the table.
void Dali::Toolkit::TableView::InsertColumn | ( | unsigned int | columnIndex | ) |
Inserts a new column to the given index.
[in] | columnIndex | The columnIndex of the new column |
void Dali::Toolkit::TableView::InsertRow | ( | unsigned int | rowIndex | ) |
Inserts a new row to given index.
[in] | rowIndex | The rowIndex of the new row |
bool Dali::Toolkit::TableView::IsFitHeight | ( | unsigned int | rowIndex | ) | const |
Checks if the row is a fit row.
[in] | rowIndex | The row to check |
bool Dali::Toolkit::TableView::IsFitWidth | ( | unsigned int | columnIndex | ) | const |
Checks if the column is a fit column.
[in] | columnIndex | The column to check |
static TableView Dali::Toolkit::TableView::New | ( | unsigned int | initialRows, |
unsigned int | initialColumns | ||
) | [static] |
Assignment operator. Changes this handle to point to another real object.
[in] | handle | Handle to an object |
Actor Dali::Toolkit::TableView::RemoveChildAt | ( | CellPosition | position | ) |
Removes a child from the given layout position.
[in] | position | The position for the child to remove |
void Dali::Toolkit::TableView::Resize | ( | unsigned int | rows, |
unsigned int | columns | ||
) |
Resizes the TableView.
[in] | rows | The rows for the table |
[in] | columns | The columns for the table |
void Dali::Toolkit::TableView::Resize | ( | unsigned int | rows, |
unsigned int | columns, | ||
std::vector< Actor > & | removed | ||
) |
Resizes the TableView.
[in] | rows | The rows for the table |
[in] | columns | The columns for the table |
[out] | removed | The removed actor handles |
void Dali::Toolkit::TableView::SetCellAlignment | ( | CellPosition | position, |
HorizontalAlignment::Type | horizontal, | ||
VerticalAlignment::Type | vertical | ||
) |
Sets the alignment on a cell.
Cells without calling this function have the default values of LEFT and TOP respectively.
[in] | position | The cell to set alignment on |
[in] | horizontal | The horizontal alignment |
[in] | vertical | The vertical alignment |
void Dali::Toolkit::TableView::SetCellPadding | ( | Size | padding | ) |
Sets horizontal and vertical padding between cells.
[in] | padding | Width and height |
void Dali::Toolkit::TableView::SetFitHeight | ( | unsigned int | rowIndex | ) |
Specifies this row as fitting its height to its children.
[in] | rowIndex | The row to set |
void Dali::Toolkit::TableView::SetFitWidth | ( | unsigned int | columnIndex | ) |
Specifies this column as fitting its width to its children.
[in] | columnIndex | The column to set |
void Dali::Toolkit::TableView::SetFixedHeight | ( | unsigned int | rowIndex, |
float | height | ||
) |
Sets a row to have fixed height. Setting a fixed height of 0 has no effect.
rowIndex | The rowIndex for row with fixed height |
height | The height in world coordinate units |
void Dali::Toolkit::TableView::SetFixedWidth | ( | unsigned int | columnIndex, |
float | width | ||
) |
Sets a column to have fixed width. Setting a fixed width of 0 has no effect.
columnIndex | The columnIndex for column with fixed width |
width | The width in world coordinate units |
void Dali::Toolkit::TableView::SetRelativeHeight | ( | unsigned int | rowIndex, |
float | heightPercentage | ||
) |
Sets a row to have relative height. Relative height means percentage of the remainder of the table height after subtracting Padding and Fixed height rows. Setting a relative height of 0 has no effect.
rowIndex | The rowIndex for row with relative height |
heightPercentage | between 0.0f and 1.0f |
void Dali::Toolkit::TableView::SetRelativeWidth | ( | unsigned int | columnIndex, |
float | widthPercentage | ||
) |
Sets a column to have relative width. Relative width means percentage of the remainder of table width after subtracting Padding and Fixed width columns. Setting a relative width of 0 has no effect.
columnIndex | The columnIndex for column with fixed width |
widthPercentage | The widthPercentage between 0.0f and 1.0f |