Skip to content

SplitterNode

Namespace: Hex1b

Assembly: Hex1b.dll

csharp
public sealed class SplitterNode : Hex1bNode, IChildLayoutProvider

Inheritance

ObjectHex1bNodeSplitterNode

Implements

Properties

First

The first child (left for horizontal, top for vertical).

Returns: Hex1bNode

csharp
public Hex1bNode? First { get; set; }

FirstSize

The size of the first pane in characters (width for horizontal, height for vertical).

Returns: Int32

csharp
public int FirstSize { get; set; }

HitTestBounds

Returns the bounds of just the divider for mouse hit testing. This prevents clicks on child panes from being captured by the splitter.

Returns: Rect

csharp
public override Rect HitTestBounds { get; }

IsFocusable

Returns true if this node can receive focus.

Returns: Boolean

csharp
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

csharp
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

csharp
public override bool IsHovered { get; set; }

Left

Returns: Hex1bNode

csharp
public Hex1bNode? Left { get; set; }

LeftWidth

Returns: Int32

csharp
public int LeftWidth { 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

csharp
public override bool ManagesChildFocus { get; }

MinFirstSize

Minimum size for the first pane (width for horizontal, height for vertical).

Returns: Int32

csharp
public int MinFirstSize { get; set; }

MinLeftWidth

Returns: Int32

csharp
public int MinLeftWidth { get; set; }

Orientation

The orientation of the splitter.

Returns: SplitterOrientation

csharp
public SplitterOrientation Orientation { get; set; }

ResizeStep

The amount to move the splitter when pressing arrow keys.

Returns: Int32

csharp
public int ResizeStep { get; set; }

Returns: Hex1bNode

csharp
public Hex1bNode? Right { get; set; }

Second

The second child (right for horizontal, bottom for vertical).

Returns: Hex1bNode

csharp
public Hex1bNode? Second { 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:

csharp
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:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

GetChildLayoutProvider(Hex1bNode)

Gets the layout provider to use when rendering a specific child.

Parameters:

  • child (Hex1bNode): The child node being rendered.

Returns: ILayoutProvider

The layout provider to use for this child, or null if no special layout provider is needed.

csharp
public ILayoutProvider? GetChildLayoutProvider(Hex1bNode child)

GetChildren()

Gets the direct children of this container for input routing.

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetChildren()

GetFocusableNodes()

Gets all focusable nodes in this subtree (including this node if focusable).

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetFocusableNodes()

InvalidateFocusCache()

csharp
public void InvalidateFocusCache()

MeasureCore(Constraints)

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

SetInitialFocus()

csharp
public void SetInitialFocus()

SyncFocusIndex()

Syncs _focusedIndex to match which child node has IsFocused = true. Call this after externally setting focus on a child node.

csharp
public override void SyncFocusIndex()

Released under the MIT License.