class BaseScrollBar
package feathers.controls.supportClasses
extends FeathersControl › MeasureSprite › ValidatingSprite
implements IScrollBar
extended by HScrollBar, VScrollBar
Base class for scroll bar components.
Events:
openfl.events.Event.CHANGE | Dispatched when |
---|---|
feathers.events.ScrollEvent.SCROLL_START | Dispatched when scrolling begins. |
feathers.events.ScrollEvent.SCROLL_COMPLETE | Dispatched when scrolling ends. |
1.0.0
.See also:
Variables
customDecrementButtonVariant:String
A custom variant to set on the decrement button, instead of
HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON
or
VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON
.
The customDecrementButtonVariant
will be not be used if the result of
decrementButtonFactory
already has a variant set.
1.0.0
.See also:
customIncrementButtonVariant:String
A custom variant to set on the increment button, instead of
HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON
or
VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON
.
The customIncrementButtonVariant
will be not be used if the result of
incrementButtonFactory
already has a variant set.
1.3.0
.See also:
decrementButtonFactory:AbstractDisplayObjectFactory<Dynamic, Button>
Creates the decrement button, which must be of type
feathers.controls.Button
.
In the following example, a custom decrement button factory is provided:
stepper.decrementButtonFactory = () ->
{
return new Button();
};
1.3.0
.See also:
enableButtonsAtRangeLimits:Bool
Indicates if the decrement button is disabled when the value is equal to minimum, and if the increment button is disabled when the value is equal to the maximum.
If the buttons remain enabled, and the user attempts to decrement beyond the minimum, or increment beyond the maximum, triggering the button will have no effect, except visually.
The following example disables the buttons at range limits:
scrollBar.enableButtonsAtRangeLimits = false;
1.3.0
.fixedThumbSize:Bool
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
.hideThumbWhenDisabled:Bool
Determines if the thumb is hidden or not when the scroll bar is disabled.
In the following example, the scroll bar's thumb is hidden when the scroll bar is disabled:
scrollBar.hideThumbWhenDisabled = true;
1.0.0
.incrementButtonFactory:AbstractDisplayObjectFactory<Dynamic, Button>
Creates the increment button, which must be of type
feathers.controls.Button
.
In the following example, a custom increment button factory is provided:
stepper.incrementButtonFactory = () ->
{
return new Button();
};
1.3.0
.See also:
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
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
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
The minimum space, in pixels, between the scroll bar track'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
The minimum space, in pixels, between the scroll bar track'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
The minimum space, in pixels, between the scroll bar track'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
The minimum space, in pixels, between the scroll bar track'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
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:InteractiveObject
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:
showDecrementAndIncrementButtons:Bool = false
Shows or hides the decrement and increment buttons. If the buttons are hidden, they will not affect the layout of other children, such as the track and thumb.
1.3.0
.snapInterval:Float
When the scroll bar's value
changes, it may be "snapped" to the
nearest multiple of snapInterval
. If snapInterval
is 0.0
, the
value
is not snapped.
In the following example, the snap inverval is changed to 1.0
:
slider.minimum = 0.0;
slider.maximum = 100.0;
slider.step = 1.0;
slider.snapInterval = 1.0;
slider.value = 10.0;
1.0.0
.See also:
step:Float
When the scroll bar's increment/decrement buttons are triggered, the
value
is modified by adding or subtracting step
.
The value should always be greater than 0.0
to ensure that the scroll
bar reacts to keyboard events when focused, and to ensure that the
increment and decrement buttons change the value when they are
triggered.
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:InteractiveObject
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:InteractiveObject
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
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:
Methods
applyValueRestrictions():Void
Applies the minimum
, maximum
, and snapInterval
restrictions to the
current value
.
Because it's possible to set value
to a numeric value that is outside
the allowed range, or to a value that has not been snapped to the
interval, this method may be called to apply the restrictions manually.
1.0.0
.setPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also: