class BaseScrollBar
package feathers.controls.supportClasses
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IScrollBar
extended by HScrollBar, VScrollBar
Base class for scroll bar components.
1.0.0
.See also:
Variables
fixedThumbSize:Bool = false
Determines if the scroll bar's thumb will be resized based on the
scrollable range between the minimum
and maximum
, or if it will
always be rendered at its preferred size, even if the minimum
and
maximum
values change.
In the following example, the thumb size is fixed:
scrollBar.fixedThumbSize = true;
1.0.0
.liveDragging:Bool = true
Determines if the scroll bar dispatches the Event.CHANGE
event every time
that the thumb moves while dragging, or only after the user stops
dragging.
In the following example, live dragging is disabled:
scrollBar.liveDragging = false;
1.0.0
.maximum:Float = 1.0
The scroll bar's value cannot be larger than the maximum.
In the following example, the maximum is set to 100.0
:
scrollBar.minimum = 0.0;
scrollBar.maximum = 100.0;
scrollBar.step = 1.0;
scrollBar.value = 12.0;
1.0.0
.See also:
minimum:Float = 0.0
The scroll bar's value cannot be smaller than the minimum.
In the following example, the minimum is set to -100.0
:
scrollBar.minimum = -100.0;
scrollBar.maximum = 100.0;
scrollBar.step = 1.0;
scrollBar.value = 50.0;
1.0.0
.See also:
paddingBottom:Float = 0.0
The minimum space, in pixels, between the scroll bar's bottom edge and the scroll bar's thumb.
In the following example, the scroll bar's bottom padding is set to 20 pixels:
scrollBar.paddingBottom = 20.0;
1.0.0
.See also:
paddingLeft:Float = 0.0
The minimum space, in pixels, between the scroll bar's left edge and the scroll bar's thumb.
In the following example, the scroll bar's left padding is set to 20 pixels:
scrollBar.paddingLeft = 20.0;
1.0.0
.See also:
paddingRight:Float = 0.0
The minimum space, in pixels, between the scroll bar's right edge and the scroll bar's thumb.
In the following example, the scroll bar's right padding is set to 20 pixels:
scrollBar.paddingRight = 20.0;
1.0.0
.See also:
paddingTop:Float = 0.0
The minimum space, in pixels, between the scroll bar's top edge and the scroll bar's thumb.
In the following example, the scroll bar's top padding is set to 20 pixels:
scrollBar.paddingTop = 20.0;
1.0.0
.See also:
page:Float = 0.0
The amount the scroll bar value must change to get from one "page" to the next or previous adjacent page.
If page
is 0.0
, the value of step
will be used instead. If step
is also 0.0
, then paging will be disabled.
In the following example, the page is changed to 10.0
:
scrollBar.minimum = 0.0;
scrollBar.maximum = 100.0;
scrollBar.step = 1.0;
scrollBar.page = 10.0;
scrollBar.value = 10.0;
1.0.0
.See also:
secondaryTrackSkin:DisplayObject = null
The skin to use for the scroll bar's optional secondary track. If a scroll bar has one track, it will fill the entire length of the scroll bar. If a scroll bar has a track and a secondary track, the primary track will stretch between the minimum edge of the scroll bar and the location of the scroll bar's thumb, while the secondary track will stretch from the location of the scroll bar's thumb to the maximum edge of the scroll bar.
In the following example, a track skin and a secondary track skin are passed to the scroll bar:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xaaaaaa);
scrollBar.trackSkin = skin;
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
scrollBar.secondaryTrackSkin = skin;
1.0.0
.See also:
step:Float = 0.0
As the scroll bar's thumb is dragged, the value
is snapped to the
nearest multiple of step
. If step
is 0.0
, the value
is not
snapped.
In the following example, the step is changed to 1.0
:
scrollBar.minimum = 0.0;
scrollBar.maximum = 100.0;
scrollBar.step = 1.0;
scrollBar.value = 10.0;
1.0.0
.See also:
thumbSkin:DisplayObject = null
The skin to use for the scroll bar's thumb.
In the following example, a thumb skin is passed to the scroll bar:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
scrollBar.thumbSkin = skin;
1.0.0
.See also:
trackSkin:DisplayObject = null
The skin to use for the scroll bar's track.
In the following example, a track skin is passed to the scroll bar:
var skin = new RectangleSkin();
skin.fill = SolidColor(0xcccccc);
scrollBar.trackSkin = skin;
1.0.0
.See also:
value:Float = 0.0
The value of the scroll bar, which must be between the minimum
and the
maximum
.
When the value
property changes, the scroll bar will dispatch an event
of type Event.CHANGE
.
In the following example, the value is changed to 12.0
:
scrollBar.minimum = 0.0;
scrollBar.maximum = 100.0;
scrollBar.step = 1.0;
scrollBar.value = 12.0;
1.0.0
.See also:
openfl.events.Event.CHANGE