ScrollPanelWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A scroll panel that provides scrolling capability for content that exceeds the available space. Only supports one direction at a time (vertical or horizontal).
public sealed record ScrollPanelWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<ScrollPanelWidget>Inheritance
Object → Hex1bWidget → ScrollPanelWidget
Implements
Constructors
ScrollPanelWidget(Hex1bWidget, ScrollOrientation, bool)
Creates a new ScrollPanelWidget.
Parameters:
child(Hex1bWidget): The child widget to scroll.orientation(ScrollOrientation): The scroll orientation. Defaults to Vertical.showScrollbar(Boolean): Whether to show the scrollbar. Defaults to true.
public ScrollPanelWidget(Hex1bWidget child, ScrollOrientation orientation = ScrollOrientation.Vertical, bool showScrollbar = true)Properties
Child
The child widget to scroll.
Returns: Hex1bWidget
public Hex1bWidget Child { get; }IsFollowing
When true, the scroll panel automatically follows the end of content. The panel scrolls to the bottom when content grows, and disengages when the user scrolls away. Re-engages when the user scrolls back to the end.
Returns: Boolean
public bool IsFollowing { get; init; }Orientation
The scroll orientation (vertical or horizontal).
Returns: ScrollOrientation
public ScrollOrientation Orientation { get; init; }ShowScrollbar
Whether to show the scrollbar when content is scrollable.
Returns: Boolean
public bool ShowScrollbar { get; init; }Methods
Follow()
Enables follow mode: the scroll panel automatically scrolls to the end when content grows. Disengages when the user scrolls away, and re-engages when the user scrolls back to the end.
Returns: ScrollPanelWidget
A new ScrollPanelWidget with follow mode enabled.
public ScrollPanelWidget Follow()OnScroll(Action<ScrollChangedEventArgs>)
Sets a synchronous scroll handler. Called when the scroll position changes.
Parameters:
handler(Action<ScrollChangedEventArgs>): The handler to call when scrolling occurs.
Returns: ScrollPanelWidget
A new ScrollPanelWidget with the handler set.
public ScrollPanelWidget OnScroll(Action<ScrollChangedEventArgs> handler)OnScroll(Func<ScrollChangedEventArgs, Task>)
Sets an asynchronous scroll handler. Called when the scroll position changes.
Parameters:
handler(Func<ScrollChangedEventArgs, Task>): The handler to call when scrolling occurs.
Returns: ScrollPanelWidget
A new ScrollPanelWidget with the handler set.
public ScrollPanelWidget OnScroll(Func<ScrollChangedEventArgs, Task> handler)Fields
FocusFirstAction
Returns: ActionId
public static readonly ActionId FocusFirstActionFocusNextAction
Returns: ActionId
public static readonly ActionId FocusNextActionFocusPreviousAction
Returns: ActionId
public static readonly ActionId FocusPreviousActionMouseScrollDownAction
Returns: ActionId
public static readonly ActionId MouseScrollDownActionMouseScrollUpAction
Returns: ActionId
public static readonly ActionId MouseScrollUpActionPageDownAction
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 ScrollRightActionScrollToEndAction
Returns: ActionId
public static readonly ActionId ScrollToEndActionScrollToStartAction
Returns: ActionId
public static readonly ActionId ScrollToStartActionScrollUpAction
Returns: ActionId
public static readonly ActionId ScrollUpAction