EZSlider is wrapper class which creates an (optional) StaticText, and a Slider plus a NumberBox. If the parent is nil
, then EZSlider will create its own window. See EZGui more options.
EZSlider's number box scrolls by default, using the step size of the ControlSpec. If the controlSpec's step is set to 0, or is not set, then the stepping and scrolling will be guessed according to the minval
and maxval
values of the spec on creation of the view. Unlike the step variable of a regular NumberBox, controlSpec.step
is also the smallest possible increment for the NumberBox. By default, the shift-key modifier will allow you to step by 100x controlSpec.step
, while the ctrl-key will give you 10x controlSpec.step
. Since the alt-key would give you 0.1 of the minimum step, it is disabled by default, but you can change that by setting numberView.alt_step
to any value you like. Accordingly you can customize the other modifiers to fit your needs. See NumberBox and Slider. This also effects the arrow keys for the slider.
parent |
The parent view or window. If the parent is |
bounds | |
label |
The label. Default value is |
controlSpec |
The ControlSpec for scaling the value. |
action |
A Function called when the value changes. The function is passed the EZSlider instance as its argument. |
initVal |
The value to initialize the slider and number box with. If |
initAction |
A Boolean indicating whether the action function should be called when setting the initial value. The default is false. |
labelWidth |
Number of pixels width for the label. The default is 60. |
numberWidth |
Number of pixels width for the number box. The default is 45. |
unitWidth |
Number of pixels width for the unit label. The default is 0. If 0, then no unitLabel is created. |
labelHeight |
The default is 20; |
layout |
|
gap |
A Point. By default, the view tries to get its parent's gap, otherwise it defaults to |
margin |
A Point. This will inset the bounds occupied by the subviews of view. |
The contained views can be accessed via the EZSlider instance variables: labelView
, sliderView
, numberView
.
Returns the numberView.
A Function or FunctionList to be evaluated when the value changes. The first argument will be the EZSlider.
The value of the slider.
Rounds the values in the number box.
An instance of ControlSpec for scaling the values.
Gets/sets the list/menu to the index at value. Does not perform the action.
val |
An Integer. |
Sets the value and performs the action at the index value and the global action.
val |
An Integer. |
Performs the action at the current index and the global action.
Set the args after creation. You can only set the label if it was not nil from the beginning.
Sets/gets it the component views are visible.
bool |
An instance of Boolean. Default is |
stringBackground |
An instance of Color. The |
stringColor |
An instance of Color. The |
sliderBackground |
An instance of Color. The slider |
numBackground |
An instance of Color. The |
numStringColor |
An instance of Color. The |
numNormalColor |
An instance of Color. The |
numTypingColor |
An instance of Color. The |
knobColor |
An instance of Color. The |
background |
An instance of Color. The |