Re: slider size [message #55648 is a reply to message #55541] |
Tue, 28 August 2007 19:56   |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
On Aug 29, 2:04 am, Loren Anderson <andersl...@yahoo.com> wrote:
>> What about SCROLL=1 and then clicking to the left/right of the slider
>> drag-thing once you are near your range?
>
> Yes, that works well, but I'd really like to be able to control it
> from the slider itself. I know I'm bring picky....
Loren,
Check the Help template below out. If it looks helpful, you can
download
discrete_slider.pro from :-
http://www.cool.id.au/IDL/discrete_slider.pro
Basically Discrete_slider adds a separate left and right button that
shunts
the slider value by the amount that you specify, in the format that
you specify.
Note that this program dates from 1993, and will probably give people
like David conniptions, or at least severe indigestion ;-)
Cheers,
Andrew
;+
;******************** HIGH FREQUENCY RADAR DIVISION, SRL
**********************
;*************************** Ionospheric Effects
*******************************
;
;HELP
;1 DISCRETE_SLIDER
; The CW_FSLIDER returns values to an accuracy of 0.000001. For many
; applications however we need the incremental step to be a pre-
determined,
; or 'discrete' floating point amount, e.g. a slider for frequency in
MHz
; ranging from 5.00 MHz to 10.00 MHz, stepping every 0.2 MHz.
;
; Users should supply an appropriate FORMAT statement to match the
step
; increment, i.e. for an increment of 0.1, a format of F4.1 might
suffice.
;
; If the FORMAT statement specifies an INTEGER format, then the
returned
; value is converted to type INTEGER.
;
;2 Setting_min_max
; DISCRETE_SLIDER allows the minimum and maximum values to be set at
any
; time with the WIDGET_CONTROL command, by supplying a structure as
input
; to the SET_VALUE keyword, e.g. :-
;
; value_st = {bot:100,top:500,inc:50,format:'(i3)',value:350}
;
; WIDGET_CONTROL,base,SET_VALUE=value_st
;
;=========================================================== ==============
;
; WARNING
;
; NOTE : The INCREMENT value is carried in the STATE structure by
; adding a new field to the 'state' and thus the 'state'
; structure as used by Compound widgets. This may yet cause
; compatibility problems with other Compound widgets that
; use the original definition of the state structure.
;
; A.D. COOL 22-JUL-93
; The DRAG keyword setting is now also carried in the STATE
structure.
; Glen Conboy 29-JUN-94
;
;=========================================================== ==============
;
;2 Examples
;
; MHz_Slider = DISCRETE_SLIDER(base,/DRAG,$
; /step,$
; increment = 0.2 ,$
; format = '(F4.1)' ,$
; MIN = 5.0 ,$
; MAX = 45.0 ,$
; /frame ,$
; XSIZE = 300 ,$
; UVALUE = "MHz" ,$
; VALUE = 20.0 ,$
; TITLE = "Frequency (MHz)")
;
; MHz_Slider = DISCRETE_SLIDER(base,/DRAG,$
; /step,$
; increment = 1.0 ,$
; format = '(I2)' ,$
; MIN = 5.0 ,$
; MAX = 45.0 ,$
; /frame ,$
; XSIZE = 300 ,$
; UVALUE = "MHz" ,$
; VALUE = 20.0 ,$
; TITLE = "Frequency (MHz)")
;
;
;
;2 KEYWORDS
; END_BUTTONS - Include single step increment/decrement buttons
; to left and right of the slider (at the ENDs).
; STEP_BUTTONS - Include single step increment/decrement buttons
; to left and right of printed value.
; INCREMENT - The discrete floating point amount by which the
; value is to change.
; DRAG - Zero if events should only be generated when the mouse
; is released. Non-zero if events should be generated
; continuously when the sliders are adjusted. Note: On slow
; systems, /DRAG performance can be inadequate. The default
; is DRAG=0.
; FORMAT - Provides the format in which the slider value is
displayed.
; This should be a format as accepted by the STRING procedure.
; The default is FORMAT='(G13.6)'
; TIME_FORMAT - Overides FORMAT keyword. Slider value is in the
format
; hh:mm. Assumes 00:00 to 23:59
; HALF_HOUR - Sets time_format slider to 30 minute intervals,
; otherwise defaults to 15 minute intervals
; TIME_INTERVAL - together with TIME_FORMAT, specifies how many
intervals in one hour.
; e.g. 12 intervals = 5 minute
spacing, 4 intervals = 15 minute jumps
; FRAME - Nonzero to have a frame drawn around the widget. The
; default is FRAME=0.
; MAXIMUM - Maximum value of slider (default=100).
; MINIMUM - Minimum value of slider (default=0).
; SUPPRESS_VALUE - If true, the current slider value is not
displayed.
; (default is to display value).
; TITLE - Title of slider (Default is no title).
; UVALUE - Supplies the user value for the widget.
; VALUE - Initial value of slider
; The default is horizontal.
; XSIZE - For horizontal sliders, sets the length.
; FONT - Obvious!!
;
|
|
|