Control for a single item inside a Tree.
    public abstract class TreeItem : Object

Control for a single item inside a Tree. May have child TreeItems and be styled as well as contain buttons.

Inheritance Chain

Properties

    public bool Collapsed { get; set; }

If true, the TreeItem is collapsed.

    public int CustomMinimumHeight { get; set; }

The custom minimum height.

    public bool DisableFolding { get; set; }

If true, folding is disabled for this TreeItem.

Methods

    public void AddButton(int column, Texture button, int buttonIdx = -1, bool disabled = false, string tooltip = "")

Adds a button with Texture button at column column. The buttonIdx index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling GetButtonCount(int) immediately after this method. Optionally, the button can be disabled and have a tooltip.

    public void ClearCustomBgColor(int column)

Resets the background color for the given column to default.

    public void ClearCustomColor(int column)

Resets the color for the given column to default.

    public void Deselect(int column)

Deselects the given column.

    public void EraseButton(int column, int buttonIdx)

Removes the button at index buttonIdx in column column.

    public Texture GetButton(int column, int buttonIdx)

Returns the Texture of the button at index buttonIdx in column column.

    public int GetButtonCount(int column)

Returns the number of buttons in column column. May be used to get the most recently added button’s index, if no index was specified.

    public TreeCellMode GetCellMode(int column)

Returns the column’s cell mode. See CELL_MODE_* constants.

    public TreeItem GetChildren()

Returns the TreeItem’s child items.

    public Color GetCustomBgColor(int column)

Returns the custom background color of column column.

    public int GetCustomMinimumHeight()

Getter for CustomMinimumHeight

    public bool GetExpandRight(int column)

Returns true if expand_right is set.

    public Texture GetIcon(int column)

Returns the given column’s icon Texture. Error if no icon is set.

    public int GetIconMaxWidth(int column)

Returns the column’s icon’s maximum width.

    public Rect2 GetIconRegion(int column)

Returns the icon Texture region as Rect2.

    public object GetMetadata(int column)

    public TreeItem GetNext()

Returns the next TreeItem in the tree.

    public TreeItem GetNextVisible()

Returns the next visible TreeItem in the tree.

    public TreeItem GetParent()

Returns the parent TreeItem.

    public TreeItem GetPrev()

Returns the previous TreeItem in the tree.

    public TreeItem GetPrevVisible()

Returns the previous visible TreeItem in the tree.

    public float GetRange(int column)

    public Dictionary GetRangeConfig(int column)

    public string GetText(int column)

Returns the given column’s text.

    public TextAlign GetTextAlign(int column)

Returns the given column’s text alignment.

    public string GetTooltip(int column)

Returns the given column’s tooltip.

    public bool IsButtonDisabled(int column, int buttonIdx)

Returns true if the button at index buttonIdx for the given column is disabled.

    public bool IsChecked(int column)

Returns true if the given column is checked.

    public bool IsCollapsed()

Getter for Collapsed

    public bool IsCustomSetAsButton(int column)

    public bool IsEditable(int column)

Returns true if column column is editable.

    public bool IsFoldingDisabled()

Getter for DisableFolding

    public bool IsSelectable(int column)

Returns true if column column is selectable.

    public bool IsSelected(int column)

Returns true if column column is selected.

    public void MoveToBottom()

Moves this TreeItem to the bottom in the Tree hierarchy.

    public void MoveToTop()

Moves this TreeItem to the top in the Tree hierarchy.

    public void RemoveChild(Object child)

Removes the given child TreeItem.

    public void Select(int column)

Selects the column column.

    public void SetButton(int column, int buttonIdx, Texture button)

Sets the given column’s button Texture at index buttonIdx to button.

    public void SetCellMode(int column, TreeCellMode mode)

Sets the given column’s cell mode to mode. See CELL_MODE_* constants.

    public void SetChecked(int column, bool @checked)

If true, the column column is checked.

    public void SetCollapsed(bool enable)

Setter for Collapsed

    public void SetCustomAsButton(int column, bool enable)

    public void SetCustomBgColor(int column, Color color, bool justOutline = false)

Sets the given column’s custom background color and whether to just use it as an outline.

    public void SetCustomColor(int column, Color color)

Sets the given column’s custom color.

    public void SetCustomDraw(int column, Object @object, string callback)

Sets the given column’s custom draw callback to callback method on object.

The callback should accept two arguments: the TreeItem that is drawn and its position and size as a Rect2.

    public void SetCustomMinimumHeight(int height)

Setter for CustomMinimumHeight

    public void SetDisableFolding(bool disable)

Setter for DisableFolding

    public void SetEditable(int column, bool enabled)

If true, column column is editable.

    public void SetExpandRight(int column, bool enable)

If true, column column is expanded to the right.

    public void SetIcon(int column, Texture texture)

Sets the given column’s icon Texture.

    public void SetIconMaxWidth(int column, int width)

Sets the given column’s icon’s maximum width.

    public void SetIconRegion(int column, Rect2 region)

Sets the given column’s icon’s texture region.

    public void SetMetadata(int column, object meta)

    public void SetRange(int column, float value)

    public void SetRangeConfig(int column, float min, float max, float step, bool expr = false)

    public void SetSelectable(int column, bool selectable)

If true, the given column is selectable.

    public void SetText(int column, string text)

    public void SetTextAlign(int column, TextAlign textAlign)

Sets the given column’s text alignment. See ALIGN_* constants.

    public void SetTooltip(int column, string tooltip)

Sets the given column’s tooltip text.

Inner Types

TextAlign

Name Value Description
Left 0 Align text to the left. See [code]set_text_align()[/code].
Center 1 Center text. See [code]set_text_align()[/code].
Right 2 Align text to the right. See [code]set_text_align()[/code].

TreeCellMode

Name Value Description
String 0 Cell contains a string.
Check 1 Cell can be checked.
Range 2 Cell contains a range.
Icon 3 Cell contains an icon.
Custom 4  
Tags: