-
Notifications
You must be signed in to change notification settings - Fork 0
Tree
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Tree |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Displays selectable Electron2D.TreeItem objects in a hierarchy.
public class Electron2D.Tree : Electron2D.ControlProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: Tree
Hierarchical UI control with root item, hidden-root mode, columns, titles, visible-item hit testing, selection state, collapsed descendants and selection/collapse signals.
Tree stores one root item and any number of descendant items. It can
hide the root row, select visible items by pointer input and expose the
current selected item through Electron2D.Tree.GetSelected.
The 0.1.0 Preview implementation focuses on runtime tree display and selection. Drag-and-drop, editing controls and scrolling are planned for later UI tasks.
This type is not synchronized. Create and mutate trees on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.ControlElectron2D.TreeItem
| Member | Kind | Summary |
|---|---|---|
AllowReselect |
Property | Gets or sets whether selecting the current item again emits signals. |
AllowRmbSelect |
Property | Gets or sets whether right mouse button input may select rows. |
AutoTooltip |
Property | Gets or sets whether automatic tooltip lookup is enabled. |
ColumnTitlesVisible |
Property | Gets or sets whether column title rows are visible. |
Columns |
Property | Gets or sets the number of columns stored by the tree. |
HideFolding |
Property | Gets or sets whether folding arrows are hidden. |
HideRoot |
Property | Gets or sets whether the root item is hidden from visible traversal. |
SelectMode |
Property | Gets or sets the current selection mode. |
Electron2D.Tree() |
Constructor | Initializes a new instance of the Electron2D.Tree class. |
Clear() |
Method | Removes all items and clears selection. |
CreateItem(Electron2D.TreeItem, System.Int32) |
Method | Creates an item in this tree. |
DeselectAll() |
Method | Clears every selected item. |
GetColumnTitle(System.Int32) |
Method | Gets the title of one column. |
GetItemAtPosition(Electron2D.Vector2) |
Method | Gets the visible item at a local position. |
GetRoot() |
Method | Gets the root item. |
GetSelected() |
Method | Gets the currently selected item. |
GetSelectedColumn() |
Method | Gets the selected column. |
SetColumnTitle(System.Int32, System.String) |
Method | Sets the title of one column. |
_Draw() |
Method | Draws the visible tree rows. |
_GetMinimumSize() |
Method | Gets the minimum size requested by this tree. |
_GuiInput(Electron2D.InputEvent) |
Method | Handles GUI input routed to this tree. |
Kind: Property
public System.Boolean AllowReselect { get; set; }Gets or sets whether selecting the current item again emits signals.
This affects pointer and programmatic selection through
Electron2D.TreeItem.Select(System.Int32,System.Boolean).
true to allow repeated selection signals; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetSelected
Kind: Property
public System.Boolean AllowRmbSelect { get; set; }Gets or sets whether right mouse button input may select rows.
Right-click selection is useful before opening a context menu.
true to allow right-click selection; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Tree._GuiInput(Electron2D.InputEvent)
Kind: Property
public System.Boolean AutoTooltip { get; set; }Gets or sets whether automatic tooltip lookup is enabled.
The preview stores this flag. Full per-cell tooltip lookup is planned with richer editor UI tasks.
true when item text may be used as tooltip fallback; otherwise,
false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Control.TooltipText
Kind: Property
public System.Boolean ColumnTitlesVisible { get; set; }Gets or sets whether column title rows are visible.
Column titles are drawn only when this flag is enabled.
true to reserve a title row; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.SetColumnTitle(System.Int32,System.String)
Kind: Property
public System.Int32 Columns { get; set; }Gets or sets the number of columns stored by the tree.
Existing item cell data is preserved when reducing the column count, but drawing and hit-testing use the current value.
A positive column count. The default is 1.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is less than1.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.SetColumnTitle(System.Int32,System.String)
Kind: Property
public System.Boolean HideFolding { get; set; }Gets or sets whether folding arrows are hidden.
The preview stores this flag and keeps collapse state functional.
true to hide folding affordances; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TreeItem.SetCollapsed(System.Boolean)
Kind: Property
public System.Boolean HideRoot { get; set; }Gets or sets whether the root item is hidden from visible traversal.
Hidden root items still own children and can be returned by
Electron2D.Tree.GetRoot.
true to hide the root row; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetRoot
Kind: Property
public Electron2D.Tree.SelectModeEnum SelectMode { get; set; }Gets or sets the current selection mode.
Switching away from multi selection clears extra selected cells.
The current Electron2D.Tree.SelectModeEnum. The default is
Electron2D.Tree.SelectModeEnum.Single.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.TreeItem.Select(System.Int32,System.Boolean)
Kind: Constructor
public Electron2D.Tree()Initializes a new instance of the Electron2D.Tree class.
The constructor enables focus, clips hit-testing and registers
item_selected, multi_selected, item_activated and
item_collapsed signals.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.Tree
Kind: Method
public System.Void Clear()()Removes all items and clears selection.
Column titles and tree configuration are preserved.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.CreateItem(Electron2D.TreeItem,System.Int32)
Kind: Method
public Electron2D.TreeItem CreateItem(Electron2D.TreeItem, System.Int32)(Electron2D.TreeItem parent, System.Int32 index)Creates an item in this tree.
The first call with a null parent creates the root. Later calls
with a null parent append a child under the root.
-
parent: The parent item, ornullto create or append under the root. -
index: The insertion index, or-1to append.
The created Electron2D.TreeItem.
-
System.ArgumentException: Thrown whenparentbelongs to another tree.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetRoot
Kind: Method
public System.Void DeselectAll()()Clears every selected item.
This method clears both tree cursor state and per-item selected flags.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetSelected
Kind: Method
public System.String GetColumnTitle(System.Int32)(System.Int32 column)Gets the title of one column.
Titles are drawn only when Electron2D.Tree.ColumnTitlesVisible is
true.
-
column: The zero-based column index.
The column title, or an empty string when no title is stored.
-
System.ArgumentOutOfRangeException: Thrown whencolumnis outside the current column range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.SetColumnTitle(System.Int32,System.String)
Kind: Method
public Electron2D.TreeItem GetItemAtPosition(Electron2D.Vector2)(Electron2D.Vector2 position)Gets the visible item at a local position.
The root row is skipped when Electron2D.Tree.HideRoot is true.
-
position: The local tree position.
The visible item at the row, or null when no row exists there.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.TreeItem.GetNextVisible
Kind: Method
public Electron2D.TreeItem GetRoot()()Gets the root item.
The root can be hidden from visible traversal by Electron2D.Tree.HideRoot.
The root item, or null when the tree is empty.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.CreateItem(Electron2D.TreeItem,System.Int32)
Kind: Method
public Electron2D.TreeItem GetSelected()()Gets the currently selected item.
In multi selection mode this returns the most recent cursor item.
The selected item, or null when nothing is selected.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetSelectedColumn
Kind: Method
public System.Int32 GetSelectedColumn()()Gets the selected column.
Row selection still records the column that received input.
The selected column, or -1 when nothing is selected.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetSelected
Kind: Method
public System.Void SetColumnTitle(System.Int32, System.String)(System.Int32 column, System.String title)Sets the title of one column.
Assigning a title queues a redraw.
-
column: The zero-based column index. -
title: The column title.
-
System.ArgumentOutOfRangeException: Thrown whencolumnis outside the current column range. -
System.ArgumentNullException: Thrown whentitleisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tree.GetColumnTitle(System.Int32)
Kind: Method
public System.Void _Draw()()Draws the visible tree rows.
Text drawing is skipped when no theme font is available.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItem.DrawRect(Electron2D.Rect2,Electron2D.Color,System.Boolean,System.Single,System.Boolean)
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Gets the minimum size requested by this tree.
The minimum height changes when items collapse or when the root is hidden.
A conservative size for the current visible row count.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetMinimumSize
Kind: Method
public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)Handles GUI input routed to this tree.
Mouse and touch press select visible items. Double-click and activation
keys emit item_activated.
-
inputEvent: The input event delivered by the viewport.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control._GuiInput(Electron2D.InputEvent)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.