previous | up | next       SimpleValue class
SimpleValue |
Click on the image for a
live example |
The basic components for setting model parameters. You can change the value by sliding the knob, or with the arrow buttons, set the range by dragging the endpoints, or just type in a number from the keyboard.
Often the sliders will have appropriate ranges to start with. Then you just slide the knob back and forth. If necessary, however, you can change the upper and lower limits, change the precision of the value, switch between logarithmic and linear scales, or type a number from the keyboard. To gain more control, without changing the ranges, click on the knob, and drag the mouse up or down away from the slider: sliding left and right then gives a finer adjustment about the starting value.
To enter a value from the keyboard place the mouse over the slider and begin to type. If you hit return before typing, it will convert to text mode and let you edit the current number as text. When you have finished hit return for the value to take effect and the display to revert to a slider. When the number is shown as text on a white background it has not yet taken effect.
If you press space with the mouse over a slider, the display changes to three checkboxes and an "OK" button. The checkboxes indicate whether the display should include a zero button for setting the value to exactly zero, precision buttons for setting the number of significant figures, and if it should be logarithmic or linear.
If present the zero button appears on the left and overrides whatever value is set on the slider. The precision button appears on the right and shows the number of significant figures to round the value to. To reduce the number of figures click it with the left mouse button. Use the right mouse button to increase the number of figures.
To change the range of the slider, press and hold the mouse on the background away from the knob or arrows. Clicking in the left half changes the lower range and in the right half the upper range. The display will change to show the current limits. Moving the mouse left or right will change one of the limits. Alternatively, the little squares besides the arrows can be used to apply standard increments as described below.
All the possible slider operations are summarized in the table.
| set a coarse value within the current range | click and drag the knob with either button. |
| key in a value | move mouse over the slider, hit return, type the number and hit return again. |
| set a fine value within the current range | set a value near the desired one, then release and start again. This time drag the mouse up or down away from the slider. Left and right movements now give a fine adjustment of the value: the further above or below, the finer the adjustment. |
| set the number of significant figures in the value | click on the figure on the right (if present) with left or right mouse buttons. (See below for how to set the slider to allow the precision to be changed). |
| set the value to 0 | click on the left button, marked zero (if present). |
| make the range smaller by a constant factor | click the small square just above the right-hand arrow. |
| make the range larger by a constant factor | click the small square just below the right-hand arrow. |
| reset the range to its original state | click the small square just below the left-hand arrow. |
| set the upper value only | click near where the value appears toward the right and drag the mouse. The display will change from showing the value to showing the new upper limit. |
| set the lower value only | click near where the name appears toward the left and drag the mouse. The display will change from showing the value to showing the new lower limit. |
| move the knob by a small fixed increment left or right | click on the left or right arrows. |
| type a number in by hand | put the mouse over the slider and press the space bar, type the number in and press return for it to take effect. |
| change the button display | put the mouse over the slider and press the space bar. The three checkboxes on the left allow you to (un)select the display of the zero button and precision buttons and to switch between a logarithmic or linear range. To revert to the normal display, click the mouse in the number field and hit return. |