A paired NumberBox and Slider, with a ControlSpec defining the range.
Essentially, this is a simpler version of EZSlider. The difference is that LayoutValueSlider uses a HLayout to position the views. You can specify the width of the number box; the HLayout sizes the slider automatically.
This means LayoutValueSlider may be used in Qt layouts (with one small trick; see the examples).
Create an instance.
parent |
If not embedding the LayoutValueSlider in a layout, give the parent view here. (If using layouts, this should be nil.) |
bounds |
If not embedding the LayoutValueSlider in a layout, give the desired bounds. (If using layouts, size and position are automatic, so this should be nil.) |
initValue |
Initial value. Any kind of SimpleNumber. |
spec |
A ControlSpec specifying the output range. |
numberWidth |
Number of pixels to allow the number box. It's set using View: -maxWidth; if the LayoutValueSlider is resized to be very small, the number box may be smaller than this. |
The LayoutValueSlider instance.
Get or set the range ControlSpec.
Get or set the action to take when the value changes. The function is passed view, value
as argument. The value is already mapped according to the range spec.
Set the value and call the user action.
Get or set the numeric value.
Second example notes:
parent
and bounds
are nil.*
. See Symbolic Notations.