ScrollbarWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A standalone scrollbar widget that can be composed with other widgets.
public sealed record ScrollbarWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<ScrollbarWidget>Inheritance
Object → Hex1bWidget → ScrollbarWidget
Implements
Constructors
ScrollbarWidget(ScrollOrientation, int, int, int)
A standalone scrollbar widget that can be composed with other widgets.
Parameters:
Orientation(ScrollOrientation): Whether the scrollbar is vertical or horizontal.ContentSize(Int32): The total size of the content being scrolled.ViewportSize(Int32): The visible viewport size.Offset(Int32): The current scroll offset.
public ScrollbarWidget(ScrollOrientation Orientation, int ContentSize, int ViewportSize, int Offset)Properties
ContentSize
The total size of the content being scrolled.
Returns: Int32
public int ContentSize { get; init; }Offset
The current scroll offset.
Returns: Int32
public int Offset { get; init; }Orientation
Whether the scrollbar is vertical or horizontal.
Returns: ScrollOrientation
public ScrollOrientation Orientation { get; init; }ViewportSize
The visible viewport size.
Returns: Int32
public int ViewportSize { get; init; }Methods
OnScroll(Action<int>)
Sets the handler for scroll offset changes.
Parameters:
handler(Action<Int32>):
Returns: ScrollbarWidget
public ScrollbarWidget OnScroll(Action<int> handler)OnScroll(Func<int, Task>)
Sets the async handler for scroll offset changes.
Parameters:
handler(Func<Int32, Task>):
Returns: ScrollbarWidget
public ScrollbarWidget OnScroll(Func<int, Task> handler)Fields
PageDownAction
Returns: ActionId
public static readonly ActionId PageDownActionPageUpAction
Returns: ActionId
public static readonly ActionId PageUpActionScrollDownAction
Returns: ActionId
public static readonly ActionId ScrollDownActionScrollLeftAction
Returns: ActionId
public static readonly ActionId ScrollLeftActionScrollRightAction
Returns: ActionId
public static readonly ActionId ScrollRightActionScrollToBottomAction
Returns: ActionId
public static readonly ActionId ScrollToBottomActionScrollToEndAction
Returns: ActionId
public static readonly ActionId ScrollToEndActionScrollToStartAction
Returns: ActionId
public static readonly ActionId ScrollToStartActionScrollToTopAction
Returns: ActionId
public static readonly ActionId ScrollToTopActionScrollUpAction
Returns: ActionId
public static readonly ActionId ScrollUpAction