TreeNode
Namespace: Hex1b
Assembly: Hex1b.dll
Container node that manages tree layout, scrolling, and guide rendering.
public sealed class TreeNode : Hex1bNodeInheritance
Properties
CascadeSelection
Whether selecting a parent cascades to all children, and partial child selection shows indeterminate state.
Returns: Boolean
public bool CascadeSelection { get; set; }IsFocusable
Returns true if this node can receive focus.
Returns: Boolean
public override bool IsFocusable { get; }IsFocused
Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).
Returns: Boolean
public override bool IsFocused { get; set; }IsHovered
Gets or sets whether the mouse is currently hovering over this node. Set by Hex1bApp based on mouse position during each frame. Only set on focusable nodes (tracked via FocusRing hit testing).
Returns: Boolean
public override bool IsHovered { get; set; }Items
The root tree item nodes.
Returns: IReadOnlyList<TreeItemNode>
public IReadOnlyList<TreeItemNode> Items { get; set; }ManagesChildFocus
Returns true if this node manages focus for its children. When a parent manages focus, child containers should NOT set initial focus themselves. Container nodes like SplitterNode should override this to return true.
Returns: Boolean
public override bool ManagesChildFocus { get; }MultiSelect
Whether multiple items can be selected.
Returns: Boolean
public bool MultiSelect { get; set; }SourceWidget
The source widget for this node.
Returns: TreeWidget
public TreeWidget? SourceWidget { get; set; }Methods
ArrangeCore(Rect)
Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.
Parameters:
bounds(Rect):
protected override void ArrangeCore(Rect bounds)ConfigureDefaultBindings(InputBindingsBuilder)
Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.
Parameters:
bindings(InputBindingsBuilder): The builder to add bindings to.
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)GetFocusableNodes()
Gets focusable nodes including this tree and any composed child nodes (checkboxes).
Returns: IEnumerable<Hex1bNode>
public override IEnumerable<Hex1bNode> GetFocusableNodes()GetSelectedItems()
Gets all selected items (for multi-select mode).
Returns: IReadOnlyList<TreeItemNode>
public IReadOnlyList<TreeItemNode> GetSelectedItems()MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)