Lysa.ui  0.0
Lysa 3D Engine
List Class Referenceabstract

Detailed Description

Base class for all list-of-widgets widgets. Fires OnInsertItem, OnRemoveItem and OnSelectItem events.

Inherits from: Widget

Lua full name: lysa.ui.List

Public Member Functions

integer add_item (item: Widget, alignment: integer, resource: string)
 Adds a widget at the end of the list and returns its 0-based index. More...
 
nil remove_item (index: integer)
 Removes the item at the given 0-based index. More...
 
nil remove_all_items ()
 Removes all items from the list. More...
 
Widget get_item (index: integer)
 Returns the widget at the given 0-based index. More...
 
nil select (index: integer)
 Selects the item at the given index; pass NO_SELECTION to clear the selection. More...
 

Properties

integer NO_SELECTION
 Sentinel value returned by selected_index when nothing is selected.
 
integer count
 Number of items currently in the list. (read-only)
 
integer selected_index
 Index (0-based) of the selected item, or NO_SELECTION if nothing is selected. (read-only)
 
Widget|nil selected_item
 The currently selected widget, or nil. (read-only)
 

Member Function Documentation

integer add_item ( Widget  item,
integer  alignment,
string  resource)

Adds a widget at the end of the list and returns its 0-based index.

Parameters
itemWidget
alignmentinteger
resourcestring
Returns
integer
nil remove_item ( integer  index)

Removes the item at the given 0-based index.

Parameters
indexinteger
nil remove_all_items ( )

Removes all items from the list.

Widget get_item ( integer  index)

Returns the widget at the given 0-based index.

Parameters
indexinteger
Returns
Widget
nil select ( integer  index)

Selects the item at the given index; pass NO_SELECTION to clear the selection.

Parameters
indexinteger

Property Documentation

integer NO_SELECTION

Sentinel value returned by selected_index when nothing is selected.

integer count

Number of items currently in the list. (read-only)

integer selected_index

Index (0-based) of the selected item, or NO_SELECTION if nothing is selected. (read-only)

Widget|nil selected_item

The currently selected widget, or nil. (read-only)