CorsixTH Lua Documentation

TreeNode Class

Interface for items within a UI tree control

Declared on: line 21 of Lua/dialogs/tree_ctrl.lua.
Subclasses: DummyRootNode, FileTreeNode

Method Index

Member Index

function TreeNode:contract()

Make the children of the item invisible

Declared on: line 104 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:expand()

Make the children of the item visible

Declared on: line 86 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getChildByIndex(idx)

Get a child of the item.

Parameters:

NameTypeDescription
idx integer An integer between 1 and getChildCount() (inclusive).

Declared on: line 44 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getChildCount()

Get the number of childrem which the item has

Declared on: line 32 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getControl()

Get the tree control within which the item is displayed

Declared on: line 66 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getHighlightColour(canvas)

Get the background colour for when the item is highlighted

Parameters:

NameTypeDescription
canvas ? ?

Declared on: line 76 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getIndexOfChild(child)

Given a child of the item, determine which index it is

Parameters:

NameTypeDescription
child TreeNode A value returned from getChildByIndex()

Declared on: line 50 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getLabel()

Get the text to be displayed for the item

Declared on: line 56 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getLevel()

Get the depth from the root item to this item.

The root item has level 0, its direct children have level 1, etc.

Declared on: line 127 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getNextVisible()

Get the next item in the on-screen display order

Declared on: line 165 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getParent()

Get the item's parent, if it has one

Declared on: line 61 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getPrevVisible()

Get the previous item in the on-screen display order

Declared on: line 143 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:getSelectColour(canvas)

Get the background colour for when the item is selected

Parameters:

NameTypeDescription
canvas ? ?

Declared on: line 81 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:hasChildren()

Query if the item has any children at all.

The simple way of doing this is checking if getChildCount() is non-zero, but often this can be implemented in a more efficient manner.

Declared on: line 37 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:isExpanded()

Query whether the item's children are visible

Declared on: line 71 of Lua/dialogs/tree_ctrl.lua.

function TreeNode:numVisibleDescendants()

The number of visible items in the set of this item and all its descendants

Declared on: line 118 of Lua/dialogs/tree_ctrl.lua.