TreeControl Class
A control (to be placed on a window) which allows the user to navigate a tree of items and select one item from it.
Declared on: line 416 of Lua/dialogs/tree_ctrl.lua.
Inheritance: TreeControl ยป Window
Subclasses: FilteredTreeControl
Inheritance: TreeControl ยป Window
Subclasses: FilteredTreeControl
Method Index
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b) (inherited from Window)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addPanel(sprite_index, x, y, w, h) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (inherited from Window)
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- close() (inherited from Window)
- draw(canvas, x, y) (overrides Window:draw)
- drawExtraOnRow(canvas, node, x, y)
- getSavedWindowPositionName() (inherited from Window)
- getTooltipAt(x, y) (inherited from Window)
- getTooltipForElement(elem, x, y) (inherited from Window)
- getWindow(window_class) (inherited from Window)
- getWindows(window_class) (inherited from Window)
- hitTest(x, y) (inherited from Window)
- hitTestPanel(x, y, panel) (inherited from Window)
- hitTestTree(x, y)
- makeButtonOnPanel(panel, x, y, w, h, sprite, on_click, on_click_self, on_rightclick) (inherited from Window)
- makeDynamicTooltip(callback, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- makeScrollbarOnPanel(panel, slider_colour, callback, min_value, max_value, page_size, value) (inherited from Window)
- makeTextboxOnPanel(panel, confirm_callback, abort_callback) (inherited from Window)
- makeTooltip(text, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (inherited from Window)
- onCursorWorldPositionChange(x, y) (inherited from Window)
- onMouseDown(button, x, y) (overrides Window:onMouseDown)
- onMouseMove(x, y) (overrides Window:onMouseMove)
- onMouseUp(button, x, y) (overrides Window:onMouseUp)
- onNumVisibleNodesChange()
- onScroll()
- onTick() (inherited from Window)
- onWorldTick() (inherited from Window)
- removeAllPanels() (inherited from Window)
- removeWindow(window) (inherited from Window)
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setDefaultPosition(x, y) (inherited from Window)
- setPosition(x, y) (inherited from Window)
- setSelectCallback(callback)
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
Member Index
- active_button (*)
- active_scrollbar (*)
- blink_counter (*)
- blinking_button (*)
- btn_repeat_delay (*)
- buttons (*)
- buttons_down (*)
- closed (*)
- default_button_sound (*)
- draggable (*)
- dragging (*)
- first_visible_node
- first_visible_ordinal
- font
- height
- highlighted_node
- key_handlers (*)
- mouse_down_in_self
- num_rows
- panel_sprites (*)
- panels (*)
- parent (*)
- row_height
- scrollbar
- scrollbars (*)
- select_callback
- selected_node
- textboxes (*)
- tooltip_regions (*)
- tree_rect
- tree_root
- tree_sprites
- ui (*)
- visible (*)
- width
- windows (*)
- x
- x_original (*)
- y
- y_offset
- y_original (*)
function TreeControl:TreeControl(root, x, y, width, height, col_bg, col_fg, y_offset, has_font)
Parameters:
Name | Type | Description |
---|---|---|
root | TreeNode | The single root node of the tree (use a `DummyRootNode` here if multiple root nodes are desired). |
x | integer | The X-position, in pixels, where the control should start within its parent. |
y | integer | The Y-position, in pixels, where the control should start within its parent. |
width | integer | The width, in pixels, of the control. |
height | integer | The height, in pixels, of the control. |
col_bg | table | The background colour of the control - this should be a table with `red`, `green`, and `blue` fields, each an integer between 0 and 255. |
col_fg | table | The colour used for the scrollbar and highlighted items. |
y_offset | ? | ? |
has_font | ? | ? |
Declared on: line 420 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:draw(canvas, x, y)
Parameters:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:draw.
Declared on: line 591 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:drawExtraOnRow(canvas, node, x, y)
Override this function if a certain row should have certain text
or additional flavour to it.
Parameters:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
node | ? | ? |
x | ? | ? |
y | ? | ? |
Declared on: line 586 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:hitTestTree(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 481 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:onMouseDown(button, x, y)
Parameters:
Name | Type | Description |
---|---|---|
button | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:onMouseDown.
Declared on: line 520 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:onMouseMove(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Overrides: Window:onMouseMove.
Declared on: line 507 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:onMouseUp(button, x, y)
Parameters:
Name | Type | Description |
---|---|---|
button | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: Window:onMouseUp.
Declared on: line 538 of Lua/dialogs/tree_ctrl.lua.
function TreeControl:setSelectCallback(callback)
Parameters:
Name | Type | Description |
---|---|---|
callback | ? | ? |
Declared on: line 533 of Lua/dialogs/tree_ctrl.lua.