A button displaying the selected item of a list, opening a popup list when clicked. Fires OnSelectItem.
Inherits from: Widget
Lua full name: lysa.ui.DropDownList
|
| integer | add_item (label: string) |
| | Adds an item at the end of the list and returns its 0-based index. More...
|
| |
| nil | set_items (items: string[]) |
| | Replaces all the items of the list. More...
|
| |
| nil | set_items (items: string[], selected: string) |
| | Replaces all the items of the list and selects the given one. More...
|
| |
| nil | remove_all_items () |
| | Removes all the items of the list. More...
|
| |
| string | get_item (index: integer) |
| | Returns the label of the item at the given index, or an empty string. More...
|
| |
| integer | index_of (label: string) |
| | Returns the index of the first item with the given label, or -1. More...
|
| |
| nil | select (index: integer) |
| | Selects the item at the given index, -1 removes the selection. More...
|
| |
| nil | select (label: string) |
| | Selects the first item with the given label. More...
|
| |
| nil | open () |
| | Opens the popup list. More...
|
| |
| nil | close () |
| | Closes the popup list. More...
|
| |
| nil | set_resources (res_button: string, res_arrow: string, res_list: string) |
| | Reloads the visual style: res_button = button, res_arrow = arrow, res_list = popup list. More...
|
| |
|
| integer | count |
| | The number of items in the list. (read-only)
|
| |
| string[] | items |
| | The labels of all the items, in display order. (read-only)
|
| |
| integer | selected_index |
| | Index of the selected item, or -1 if none is selected. (read-only)
|
| |
| string | selected_item |
| | Label of the selected item, or an empty string. (read-only)
|
| |
| string | place_holder |
| | Text displayed by the button when no item is selected.
|
| |
| boolean | is_open |
| | True while the popup list is displayed. (read-only)
|
| |
| integer | max_displayed_items |
| | Maximum number of items displayed at once by the popup list.
|
| |
| number | arrow_width |
| | Width of the arrow drawn at the right of the button.
|
| |
| Button | button |
| | The clickable button displaying the selected item. (read-only)
|
| |
| Text | label |
| | The text widget displaying the selected item. (read-only)
|
| |
| Arrow | arrow |
| | The arrow displaying the open state. (read-only)
|
| |
| string | list_resource |
| | Resource string used to style the popup list.
|
| |