Lysa.ui  0.0
Lysa 3D Engine
TabContainer Class Referenceabstract

Detailed Description

A container displaying one widget at a time, selected with a TabBar. Fires OnSelectItem with the displayed widget when a tab is selected.

Inherits from: Panel

Lua full name: lysa.ui.TabContainer

Public Member Functions

Widget add_tab (label: string, content: Widget)
 Adds a widget displayed by a new tab and returns it. More...
 
Widget add_tab (label: string, content: Widget, resource: string)
 Adds a widget displayed by a new tab, loading the style of the tab text from a resource string. More...
 
Widget add_tab (label: string, content: Widget, resource: string, leading: Widget)
 Adds a widget displayed by a new tab showing the given widget (icon, mark, ...) at the left of the text. More...
 
nil remove_tab (index: integer)
 Removes a tab and the widget it displays. More...
 
nil remove_all_tabs ()
 Removes all the tabs and the widgets they display. More...
 
Text|nil get_tab (index: integer)
 Returns the text widget of a tab, or nil for an invalid index. More...
 
Widget|nil get_content (index: integer)
 Returns the widget displayed by a tab, or nil for an invalid index. More...
 
integer get_index_of (content: Widget)
 Returns the index of the tab displaying the given widget, or NO_TAB. More...
 
nil select (index: integer)
 Selects a tab and displays the widget it displays. More...
 
nil set_resources (res_tab_bar: string)
 Reloads the visual style: res_tab_bar = bar of tabs. More...
 

Properties

integer NO_TAB
 Sentinel value used when no tab is selected or found.
 
integer count
 The number of tabs. (read-only)
 
integer selected
 The index of the selected tab, or NO_TAB. (read-only)
 
Widget|nil selected_content
 The widget displayed by the selected tab, or nil. (read-only)
 
TabBar tab_bar
 The bar displaying the tabs. (read-only)
 
Widget content_area
 The widget holding the widgets displayed by the tabs. (read-only)
 
number tab_bar_height
 The height of the bar of tabs, zero to adjust it to the content of the tabs.
 
integer placement
 The position of the bar of tabs relatively to the displayed widgets (see lysa.ui.TabPlacement).
 

Member Function Documentation

Widget add_tab ( string  label,
Widget  content)

Adds a widget displayed by a new tab and returns it.

Parameters
labelstring
contentWidget
Returns
Widget
Widget add_tab ( string  label,
Widget  content,
string  resource)

Adds a widget displayed by a new tab, loading the style of the tab text from a resource string.

Parameters
labelstring
contentWidget
resourcestring
Returns
Widget
Widget add_tab ( string  label,
Widget  content,
string  resource,
Widget  leading)

Adds a widget displayed by a new tab showing the given widget (icon, mark, ...) at the left of the text.

Parameters
labelstring
contentWidget
resourcestring
leadingWidget
Returns
Widget
nil remove_tab ( integer  index)

Removes a tab and the widget it displays.

Parameters
indexinteger
nil remove_all_tabs ( )

Removes all the tabs and the widgets they display.

Text|nil get_tab ( integer  index)

Returns the text widget of a tab, or nil for an invalid index.

Parameters
indexinteger
Returns
Text|nil
Widget|nil get_content ( integer  index)

Returns the widget displayed by a tab, or nil for an invalid index.

Parameters
indexinteger
Returns
Widget|nil
integer get_index_of ( Widget  content)

Returns the index of the tab displaying the given widget, or NO_TAB.

Parameters
contentWidget
Returns
integer
nil select ( integer  index)

Selects a tab and displays the widget it displays.

Parameters
indexinteger
nil set_resources ( string  res_tab_bar)

Reloads the visual style: res_tab_bar = bar of tabs.

Parameters
res_tab_barstring

Property Documentation

integer NO_TAB

Sentinel value used when no tab is selected or found.

integer count

The number of tabs. (read-only)

integer selected

The index of the selected tab, or NO_TAB. (read-only)

Widget|nil selected_content

The widget displayed by the selected tab, or nil. (read-only)

TabBar tab_bar

The bar displaying the tabs. (read-only)

Widget content_area

The widget holding the widgets displayed by the tabs. (read-only)

number tab_bar_height

The height of the bar of tabs, zero to adjust it to the content of the tabs.

integer placement

The position of the bar of tabs relatively to the displayed widgets (see lysa.ui.TabPlacement).