Skip to main content

Slider and Scrollbar

Sliders and scrollbars have parts that move along a track. The control places these parts itself, by giving them an absolute position in percent of their parent (the track). Do not set the layout of the parts along the axis of the control.

Direction (TrackDirection) sets the axis and the direction of both controls: LeftToRight, RightToLeft, BottomToTop or TopToBottom.

YauiSlider​

YauiSlider picks a value in a range by dragging along its track, or with the navigation keys along its direction.

Slider YauiElement, YauiSlider
├─ FillArea YauiElement (the track of the fill)
│ └─ Fill YauiElement (from the start to the value)
└─ HandleArea YauiElement (the track of the handle)
└─ Handle YauiElement (centered on the value)
MemberDescription
FillPlaced from the start of its track to the value (optional)
HandleCentered on the value in its track (optional)
MinValue, MaxValueThe range
WholeNumbersWhether the value is rounded to integers
Value, NormalizedValueThe value, and the value from 0 to 1
OnValueChangedInvoked with the new value when it changes
SetValueWithoutNotify(value)Changes the value without invoking OnValueChanged

YauiScrollbar​

YauiScrollbar has a handle whose size is a fraction of its track (the visible part of a scrolled content), at a position from 0 to 1. Dragging the handle moves it, and pressing the track moves it a page toward the pointer.

Scrollbar YauiElement (the track), YauiScrollbar
└─ Handle YauiElement
MemberDescription
HandleThe handle, placed in its parent
ValueThe position from 0 to 1
SizeThe size of the handle, as a fraction of the track
NumberOfStepsThe number of positions the value snaps to, or 0 for none
OnValueChangedInvoked with the new value when it changes
SetValueWithoutNotify(value)Changes the value without invoking OnValueChanged

A scroll view drives the size and value of its scrollbars.