Module CorsixTH.CorsixTH.Lua.dialogs.resizables.dropdown
Dropdown "window" used for selection of one item from a list.
Functions
| UIDropdown:UIDropdown (ui, parent_window, parent_button, items, callback, colour) | Constructor for the dropdown "window" |
| UIDropdown:onMouseDown (button, x, y) | Let dropdown close when clicked outside of |
Functions
- UIDropdown:UIDropdown (ui, parent_window, parent_button, items, callback, colour)
-
Constructor for the dropdown "window"
Parameters:
- ui (UI) The ui the window is created in
- parent_window (Window) The window that this dropdown will be attached to
- parent_button (Button) The button in the parent_window that this dropdown will be positioned under
- items (table) A list of items for the list to display, where each item is a table with at least the field text, and optionally fields font and/or tooltip, which is a table containing text, x and y positions.
- callback (function) A function to be called when an item is selected. It is called with two parameters: The parent window and the index of the selected item
- colour (table) A colour in the form of {red = ..., green = ..., blue = ...}. Optional if parent_window is a UIResizable
- UIDropdown:onMouseDown (button, x, y)
-
Let dropdown close when clicked outside of
Parameters:
- button (button) mouseclick
- x (coord) x coordinate
- y (coord) y coordinate
Returns:
-
continue triggering parent function