Lysa.ui  0.0
Lysa 3D Engine
TreeView Class Referenceabstract

Detailed Description

A hierarchical list widget that displays items in an expandable/collapsible tree structure.

Inherits from: Widget

Lua full name: lysa.ui.TreeView

Public Member Functions

nil set_resources (resBox: string, resScroll: string, resIndent: string, resSelection: string, resPointed: string)
 Reloads the visual style: resBox = background box, resScroll = scroll bar, resIndent = width of an indentation level, resSelection = highlight of the selected items, resPointed = highlight of the item below the mouse cursor. More...
 
nil remove_all_items ()
 Removes and destroys all items from the tree. More...
 
TreeViewItem add_item (parent_or_widget: TreeViewItem|Widget, widget: Widget|nil)
 Adds an item to the tree. Pass only a widget to add a root-level item; pass a TreeViewItem and a widget to add a child under that item. More...
 
nil expand (item: Widget)
 Expands the tree item associated with the given content widget. More...
 
nil expand (item: TreeViewItem, expanded: boolean)
 Expands or collapses a tree item, displaying or hiding its children. More...
 
TreeViewItem|nil get_item (item: Widget)
 Returns the tree item displaying the given widget, nil if not found. More...
 
nil expand_all (expanded: boolean)
 Expands or collapses every item of the tree at once, without emitting OnExpandItem. More...
 
nil select (item: TreeViewItem, selected: boolean)
 Selects or unselects an item, emitting OnSelectItem if the selection changed. More...
 
nil unselect_all ()
 Unselects every item. More...
 
TreeViewItem[] get_selected_items ()
 Returns the selected items, in display order. More...
 

Properties

integer selection_mode
 The selection behavior (see lysa.ui.TreeViewSelectionMode).
 
TreeViewItem|nil selected_item
 The first selected item in display order, nil if the selection is empty. (read-only)
 
TreeViewItem|nil pointed_item
 The displayed item below the mouse cursor, nil if none. (read-only)
 

Member Function Documentation

nil set_resources ( string  resBox,
string  resScroll,
string  resIndent,
string  resSelection,
string  resPointed)

Reloads the visual style: resBox = background box, resScroll = scroll bar, resIndent = width of an indentation level, resSelection = highlight of the selected items, resPointed = highlight of the item below the mouse cursor.

Parameters
resBoxstring
resScrollstring
resIndentstring
resSelectionstring
resPointedstring
nil remove_all_items ( )

Removes and destroys all items from the tree.

TreeViewItem add_item ( TreeViewItem|Widget  parent_or_widget,
Widget|nil  widget)

Adds an item to the tree. Pass only a widget to add a root-level item; pass a TreeViewItem and a widget to add a child under that item.

Parameters
parent_or_widgetTreeViewItem|Widget
widgetWidget|nil
Returns
TreeViewItem
nil expand ( Widget  item)

Expands the tree item associated with the given content widget.

Parameters
itemWidget
nil expand ( TreeViewItem  item,
boolean  expanded)

Expands or collapses a tree item, displaying or hiding its children.

Parameters
itemTreeViewItem
expandedboolean
TreeViewItem|nil get_item ( Widget  item)

Returns the tree item displaying the given widget, nil if not found.

Parameters
itemWidget
Returns
TreeViewItem|nil
nil expand_all ( boolean  expanded)

Expands or collapses every item of the tree at once, without emitting OnExpandItem.

Parameters
expandedboolean
nil select ( TreeViewItem  item,
boolean  selected)

Selects or unselects an item, emitting OnSelectItem if the selection changed.

Parameters
itemTreeViewItem
selectedboolean
nil unselect_all ( )

Unselects every item.

TreeViewItem[] get_selected_items ( )

Returns the selected items, in display order.

Returns
TreeViewItem[]

Property Documentation

integer selection_mode

The selection behavior (see lysa.ui.TreeViewSelectionMode).

TreeViewItem|nil selected_item

The first selected item in display order, nil if the selection is empty. (read-only)

TreeViewItem|nil pointed_item

The displayed item below the mouse cursor, nil if none. (read-only)