Skip to content

ListNode

Namespace: Hex1b

Assembly: Hex1b.dll

csharp
public sealed class ListNode : Hex1bNode

Inheritance

ObjectHex1bNodeListNode

Properties

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

IsScrollable

Whether the list needs scrolling (more items than viewport height).

Returns: Boolean

csharp
public bool IsScrollable { get; }

Items

The list items to display.

Returns: IReadOnlyList<String>

csharp
public IReadOnlyList<string> Items { get; set; }

MaxScrollOffset

The maximum scroll offset based on item count and viewport height.

Returns: Int32

csharp
public int MaxScrollOffset { get; }

ScrollOffset

Returns: Int32

csharp
public int ScrollOffset { get; set; }

SelectedIndex

Returns: Int32

csharp
public int SelectedIndex { get; set; }

SelectedText

The text of the currently selected item, or null if the list is empty.

Returns: String

csharp
public string? SelectedText { get; }

SourceWidget

The source widget that was reconciled into this node.

Returns: ListWidget

csharp
public ListWidget? SourceWidget { get; set; }

ViewportHeight

Returns: Int32

csharp
public int ViewportHeight { get; }

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)

HandleMouseClick(int, int, Hex1bMouseEvent)

Handles mouse click by selecting the item at the clicked row.

Parameters:

Returns: InputResult

csharp
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)

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.