Skip to content

CheckboxNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for CheckboxWidget.

csharp
public sealed class CheckboxNode : Hex1bNode

Inheritance

ObjectHex1bNodeCheckboxNode

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

Label

Optional label displayed after the checkbox.

Returns: String

csharp
public string? Label { get; set; }

SourceWidget

The source widget for typed event args.

Returns: CheckboxWidget

csharp
public CheckboxWidget? SourceWidget { get; set; }

State

The current state of the checkbox.

Returns: CheckboxState

csharp
public CheckboxState State { get; set; }

ToggledCallback

Callback for the toggle event.

Returns: Func<InputBindingActionContext, Task>

csharp
public Func<InputBindingActionContext, Task>? ToggledCallback { get; set; }

Methods

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)

GetCheckboxWidth(Hex1bTheme)

Gets the width of the checkbox box (e.g., "[x]" = 3).

Parameters:

Returns: Int32

csharp
public int GetCheckboxWidth(Hex1bTheme theme)

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.