class

AScrollBar

Module
Arc
Header
#include "Arc/Widgets/AScrollBox.h"
Namespace
Arcf

Type aliases

AliasDescription
using COnScrolled = ArcDelegate<void(float )>Callback when user drags the scrollbar

Properties

TypeNameDescription
static constexpr floatHIDE_DELAYSeconds an AutoHide bar stays up after the last scroll. Default 0.8f.
COnScrolledOnScrolled
static constexpr floatMIN_THUMB_SIZEBelow this a thumb is a sliver nobody can hit, so paint and hit test both clamp to it — which is why the thumb's travel is derived from the clamped length and never from the raw fraction. Default 24.0f.

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
WidgetArgsType&Visibility
ARC_WIDGET_ARGS_END
ArcVec2ComputeDesiredSize
int32_tOnPaint
CReplyOnMouseButtonDown
CReplyOnMouseButtonUp
CReplyOnMouseMove
voidOnMouseEnter
voidOnMouseLeave
voidOnMouseCaptureLost
EArcCursorTypeOnCursorQuery
EHitTestResultOnHitTestA bar with nothing to scroll is out of the pointer path entirely.
voidSetScrollStateSet scroll state (0..1 range)
floatGetScrollOffset
floatGetThumbFraction
boolIsDraggingThumb
boolIsPagingTrack
voidAdvanceRepeatRuns the hold-to-repeat page timer.
voidAdvanceFadeRuns the AutoHide fade.
floatGetFadeOpacity0 hidden, 1 fully shown; AlwaysVisible is always 1.
boolWantsToShowTrue while something asks the bar to be shown: a recent scroll, the pointer over the bar or its scroll area, or a drag or page in hand.
EScrollBarVisibilityGetVisibility
boolCanCacheDesiredSizeIts thickness on one axis and nothing on the other; the thumb is a fraction of the track, not a size input.
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(AScrollBar) ARC_ARG(EOrientation, Orientation) EScrollBarVisibility _Visibility = EScrollBarVisibility::AutoHide

Visibility

C++
WidgetArgsType& Visibility(EScrollBarVisibility value)

ARC_WIDGET_ARGS_END

C++
ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

OnMouseButtonDown

C++
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) override

OnMouseButtonUp

C++
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) override

OnMouseMove

C++
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) override

OnMouseEnter

C++
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) override

OnMouseLeave

C++
void OnMouseLeave(const CPointerEvent& event) override

OnMouseCaptureLost

C++
void OnMouseCaptureLost() override

OnCursorQuery

C++
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const override

OnHitTest

C++
EHitTestResult OnHitTest(const CGeometry& geo, const ArcVec2& absolutePosition) const override

A bar with nothing to scroll is out of the pointer path entirely. Its slot is a gutter reserved over the content, and claiming the hit there left the rightmost strip of every list dead to the mouse.

SetScrollState

C++
void SetScrollState(float offset, float thumbFraction)

Set scroll state (0..1 range)

GetScrollOffset

C++
float GetScrollOffset() const

GetThumbFraction

C++
float GetThumbFraction() const

IsDraggingThumb

C++
bool IsDraggingThumb() const

IsPagingTrack

C++
bool IsPagingTrack() const

AdvanceRepeat

C++
void AdvanceRepeat(float deltaSeconds) const

Runs the hold-to-repeat page timer. OnPaint feeds it the frame delta, which is the only clock a widget has here; a headless test drives it directly instead of pretending to paint.

AdvanceFade

C++
void AdvanceFade(float deltaSeconds) const

Runs the AutoHide fade. OnPaint feeds it the frame delta; a headless test drives it directly.

GetFadeOpacity

C++
float GetFadeOpacity() const

0 hidden, 1 fully shown; AlwaysVisible is always 1.

WantsToShow

C++
bool WantsToShow() const

True while something asks the bar to be shown: a recent scroll, the pointer over the bar or its scroll area, or a drag or page in hand.

GetVisibility

C++
EScrollBarVisibility GetVisibility() const

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

Its thickness on one axis and nothing on the other; the thumb is a fraction of the track, not a size input.

GetTypeName

C++
const char* GetTypeName() const override
Generated from Arc/Widgets/AScrollBox.h via arc.json · Nov 5, 2026Version 1.0.0