ScrollbarNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
A standalone scrollbar node that handles thumb dragging and track clicking.
public sealed class ScrollbarNode : Hex1bNodeInheritance
Object → Hex1bNode → ScrollbarNode
Properties
ContentSize
The total size of the content being scrolled.
Returns: Int32
public int ContentSize { 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; }IsScrollable
Whether the scrollbar is needed (content exceeds viewport).
Returns: Boolean
public bool IsScrollable { get; }MaxOffset
The maximum scroll offset.
Returns: Int32
public int MaxOffset { get; }Offset
The current scroll offset.
Returns: Int32
public int Offset { get; set; }Orientation
The scrollbar orientation.
Returns: ScrollOrientation
public ScrollOrientation Orientation { get; set; }ScrollHandler
Handler called when scroll offset changes.
Returns: Func<Int32, Task>
public Func<int, Task>? ScrollHandler { get; set; }ViewportSize
The visible viewport size.
Returns: Int32
public int ViewportSize { 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)HandleMouseClick(int, int, Hex1bMouseEvent)
Handles a mouse click event (after mouse bindings have been checked). Override this in nodes to handle clicks that weren't matched by any mouse binding. The coordinates in the event are local to this node's bounds (0,0 is top-left of node).
Parameters:
localX(Int32): The X coordinate relative to this node's bounds.localY(Int32): The Y coordinate relative to this node's bounds.mouseEvent(Hex1bMouseEvent): The original mouse event (with absolute coordinates).
Returns: InputResult
Handled if the click was consumed, NotHandled otherwise.
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)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)