Skip to content

ScrollbarWidget ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A standalone scrollbar widget that can be composed with other widgets.

csharp
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.
csharp
public ScrollbarWidget(ScrollOrientation Orientation, int ContentSize, int ViewportSize, int Offset)

Properties ​

ContentSize ​

The total size of the content being scrolled.

Returns: Int32

csharp
public int ContentSize { get; init; }

Offset ​

The current scroll offset.

Returns: Int32

csharp
public int Offset { get; init; }

Orientation ​

Whether the scrollbar is vertical or horizontal.

Returns: ScrollOrientation

csharp
public ScrollOrientation Orientation { get; init; }

ViewportSize ​

The visible viewport size.

Returns: Int32

csharp
public int ViewportSize { get; init; }

Methods ​

OnScroll(Action<int>) ​

Sets the handler for scroll offset changes.

Parameters:

Returns: ScrollbarWidget

csharp
public ScrollbarWidget OnScroll(Action<int> handler)

OnScroll(Func<int, Task>) ​

Sets the async handler for scroll offset changes.

Parameters:

Returns: ScrollbarWidget

csharp
public ScrollbarWidget OnScroll(Func<int, Task> handler)

Fields ​

PageDownAction ​

Returns: ActionId

csharp
public static readonly ActionId PageDownAction

PageUpAction ​

Returns: ActionId

csharp
public static readonly ActionId PageUpAction

ScrollDownAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollDownAction

ScrollLeftAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollLeftAction

ScrollRightAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollRightAction

ScrollToBottomAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollToBottomAction

ScrollToEndAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollToEndAction

ScrollToStartAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollToStartAction

ScrollToTopAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollToTopAction

ScrollUpAction ​

Returns: ActionId

csharp
public static readonly ActionId ScrollUpAction

Released under the MIT License.