Control to show a tree of items.
This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions. Trees are built via code, using [TreeItem] objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added. [codeblock] func _ready(): var tree = Tree.new() var root = tree.create_item() tree.set_hide_root(true) var child1 = tree.create_item(root) var child2 = tree.create_item(root) var subchild1 = tree.create_item(child1) subchild1.set_text(0, "Subchild1") [/codeblock]
Returns [code]true[/code] if the column titles are being shown.
Clears the tree. This removes all items.
Create an item in the tree and add it as the last child of [code]parent[/code]. If parent is not given, it will be added as the root's last child, or it'll the be the root itself if the tree is empty.
Makes the currently selected item visible. This will scroll the tree to make sure the selected item is visible.
Returns [code]true[/code] if a cell that is currently already selected may be selected again.
Returns [code]true[/code] if a right click can select items.
Returns the column index under the given point.
Returns the column's title.
Returns the column's width in pixels.
Returns the amount of columns.
Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [method TreeItem.set_cell_mode].
Returns the current drop mode's flags.
Returns the currently edited item. This is only available for custom cell mode.
Returns the column for the currently edited item. This is only available for custom cell mode.
Returns the rectangle area for the specified item. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.
Returns the tree item at the specified position (relative to the tree origin position).
Returns the next selected item after the given one.
Returns the last pressed button's index.
Returns the tree's root item.
Returns the current scrolling position.
Returns the currently selected item.
Returns the current selection's column.
Returns [code]true[/code] if the folding arrow is hidden.
If [code]true[/code] the currently selected cell may be selected again.
If [code]true[/code] a right mouse button click can select items.
If [code]true[/code] the column will have the "Expand" flag of [Control].
Set the minimum width of a column.
Set the title of a column.
If [code]true[/code] column titles are visible.
Set the amount of columns.
Set the drop mode as an OR combination of flags. See [code]DROP_MODE_*[/code] constants.
If [code]true[/code] the folding arrow is hidden.
If [code]true[/code] the tree's root is hidden.
Allow single or multiple selection. See the [code]SELECT_*[/code] constants.
Emitted when a button on the tree was pressed (see [method TreeItem.add_button]).
Emitted when a cell is selected.
Emitted when a column's title is pressed.
Emitted when a cell with the [code]CELL_MODE_CUSTOM[/code] is clicked to be edited.
Emitted when the right mouse button is pressed if RMB selection is active and the tree is empty.
Emitted when an item is activated (double-clicked).
Emitted when an item is collapsed by a click on the folding arrow.
Emitted when an item is double clicked.
Emitted when an item is edited.
Emitted when an item is edited using the right mouse button.
Emitted when an item is selected with right mouse button.
Emitted when an item is selected with right mouse button.
Emitted instead of [code]item_selected[/code] when [code]select_mode[/code] is [code]SELECT_MULTI[/code].
Allow selection of a single item at a time.
Allow selection of multiple items at the same time.