Skip to content

DragBarPanelNode

Namespace: Hex1b

Assembly: Hex1b.dll

Node for a DragBarPanel — a container with a resize handle on one edge. The handle can be dragged with the mouse or moved with arrow keys when focused.

csharp
public sealed class DragBarPanelNode : Hex1bNode, IChildLayoutProvider

Inheritance

ObjectHex1bNodeDragBarPanelNode

Implements

Properties

ContentChild

The content child node.

Returns: Hex1bNode

csharp
public Hex1bNode? ContentChild { get; set; }

CurrentSize

The current size of the panel in characters along the drag axis. Mutated by drag/keyboard input; preserved across reconciliation.

Returns: Int32

csharp
public int CurrentSize { get; set; }

HitTestBounds

Hit test targets only the handle area, not the content.

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; }

MaxSize

Maximum allowed size (null = no maximum).

Returns: Nullable<Int32>

csharp
public int? MaxSize { get; set; }

MinSize

Minimum allowed size.

Returns: Int32

csharp
public int MinSize { get; set; }

ResizeStep

Step size for keyboard resizing.

Returns: Int32

csharp
public int ResizeStep { get; set; }

ResolvedEdge

Which edge the handle is on (set during reconciliation).

Returns: DragBarEdge

csharp
public DragBarEdge ResolvedEdge { 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 node. Used for input routing and tree traversal. Container nodes should override this to return their children.

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()

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)

Released under the MIT License.