Lysa.ui  0.0
Lysa 3D Engine
FoldableContainer Class Referenceabstract

Detailed Description

A container folding and unfolding its content with a clickable title bar. Fires OnExpandItem with the content widget when the state changes.

Inherits from: Widget

Lua full name: lysa.ui.FoldableContainer

Public Member Functions

Widget add_content (child: Widget)
 Adds a widget to the content and updates the height of the container. More...
 
Widget add_content (child: Widget, alignment: Alignment)
 Adds a widget to the content with the given alignment. More...
 
Widget add_content (child: Widget, alignment: Alignment, resource: string)
 Adds a widget to the content, loading its style from a resource string. More...
 
nil remove_content (child: Widget)
 Removes a widget from the content and updates the height of the container. More...
 
nil remove_all_content ()
 Removes all the widgets of the content and updates the height of the container. More...
 
nil toggle ()
 Folds the content if it is displayed, unfolds it otherwise. More...
 
nil update_size ()
 Recomputes the height of the title bar and of the container. More...
 
nil set_resources (res_title_bar: string, res_arrow: string)
 Reloads the visual style: res_title_bar = clickable title bar, res_arrow = folded state arrow. More...
 

Properties

string title
 The text of the title bar.
 
boolean folded
 True when the content is hidden.
 
Button title_bar
 The clickable title bar. (read-only)
 
Text title_widget
 The text widget displaying the title. (read-only)
 
Arrow arrow
 The arrow displaying the folded state. (read-only)
 
Widget content
 The widget holding the content. (read-only)
 
number title_bar_height
 The height of the title bar, zero to adjust it to the title.
 
number content_height
 The height of the content when unfolded, zero to adjust it to the widgets it holds.
 
number auto_title_bar_height
 The height needed to display the title. (read-only)
 
number auto_content_height
 The height needed to display all the widgets of the content. (read-only)
 

Member Function Documentation

Widget add_content ( Widget  child)

Adds a widget to the content and updates the height of the container.

Parameters
childWidget
Returns
Widget
Widget add_content ( Widget  child,
Alignment  alignment)

Adds a widget to the content with the given alignment.

Parameters
childWidget
alignmentAlignment
Returns
Widget
Widget add_content ( Widget  child,
Alignment  alignment,
string  resource)

Adds a widget to the content, loading its style from a resource string.

Parameters
childWidget
alignmentAlignment
resourcestring
Returns
Widget
nil remove_content ( Widget  child)

Removes a widget from the content and updates the height of the container.

Parameters
childWidget
nil remove_all_content ( )

Removes all the widgets of the content and updates the height of the container.

nil toggle ( )

Folds the content if it is displayed, unfolds it otherwise.

nil update_size ( )

Recomputes the height of the title bar and of the container.

nil set_resources ( string  res_title_bar,
string  res_arrow)

Reloads the visual style: res_title_bar = clickable title bar, res_arrow = folded state arrow.

Parameters
res_title_barstring
res_arrowstring

Property Documentation

string title

The text of the title bar.

boolean folded

True when the content is hidden.

Button title_bar

The clickable title bar. (read-only)

Text title_widget

The text widget displaying the title. (read-only)

Arrow arrow

The arrow displaying the folded state. (read-only)

Widget content

The widget holding the content. (read-only)

number title_bar_height

The height of the title bar, zero to adjust it to the title.

number content_height

The height of the content when unfolded, zero to adjust it to the widgets it holds.

number auto_title_bar_height

The height needed to display the title. (read-only)

number auto_content_height

The height needed to display all the widgets of the content. (read-only)