A vertical list of text items, optionally split into groups by separator lines. Fires OnSelectItem when an item is clicked.
Inherits from: Widget
Lua full name: lysa.ui.Menu
|
| integer | add_item (label: string) |
| | Adds an item at the end of the menu and returns its 0-based index, separators excluded. More...
|
| |
| integer | add_item (label: string, shortcut: string) |
| | Adds an item with a right-aligned shortcut text. More...
|
| |
| integer | add_item (label: string, shortcut: string, resource: string, shortcut_resource: string) |
| | Adds an item with a shortcut, loading the item and shortcut styles from resource strings. More...
|
| |
| integer | add_item (label: string, shortcut: string, resource: string, shortcut_resource: string, leading: Widget) |
| | Adds an item displaying the given widget (check mark, radio button, ...) at the left of the text. More...
|
| |
| nil | add_separator () |
| | Adds a line separating the previous items from the next ones. More...
|
| |
| nil | add_separator (resource: string) |
| | Adds a separator line, loading its style from a resource string. More...
|
| |
| nil | remove_all_items () |
| | Removes all the items and separators. More...
|
| |
| Text|nil | get_item (index: integer) |
| | Returns the text widget of an item, or nil for an invalid index. More...
|
| |
| Text|nil | get_item_shortcut (index: integer) |
| | Returns the shortcut text widget of an item, or nil if the item has no shortcut. More...
|
| |
| integer | get_item_at (x: number, y: number) |
| | Returns the index of the item at the given position, or -1 if there is none. More...
|
| |
| nil | highlight (index: integer) |
| | Highlights an item, -1 removes the highlight. More...
|
| |
| nil | set_resources (res_separator: string, res_highlight: string) |
| | Reloads the visual style: res_separator = separator lines, res_highlight = highlight of the item under the mouse. More...
|
| |
|
| integer | count |
| | The number of items, separators excluded. (read-only)
|
| |
| integer | highlighted |
| | The index of the highlighted item, or -1. (read-only)
|
| |
| number | item_padding |
| | The space between the borders of an item and its text, applied to the next added items.
|
| |
| number | content_height |
| | The height needed to display all the items and separators. (read-only)
|
| |
| number | content_width |
| | The width needed to display the widest item, shortcut included. (read-only)
|
| |