|
IDL Reference Guide: IDL GUIBuilder Widget Reference |
|
Horizontal or vertical slider widgets allow for the selection of a value within a range of possible integer values. A slider widget is a rectangular region representing a range of values, with a sliding pointer inside that indicates or selects the current value. This sliding pointer can be manipulated by the user dragging it with the mouse, or within IDL code.
When programming in IDL, you create horizontal or vertical slider widgets using the WIDGET_SLIDER function. See WIDGET_SLIDER.
For slider widgets, you can set common attributes and slider-specific attributes. For a list of common attributes, see Common Attributes. The following is a list of slider attributes:
The Maximum Value attribute specifies the maximum range value for the slider. The default value is 100, but you can set this attribute to any integer. This value works with the Minimum Value attribute.
In the generated *.pro file, this value is specified with the MAXIMUM keyword to the widget creation routine.
The Minimum Value attribute specifies the minimum range value of the slider. The default value is 0, but you can set this attribute to any integer. This attribute works with the Maximum Value attribute.
In the generated *.pro file, this value is specified with the MINIMUM keyword to the widget creation routine.
The Position attribute specifies the initial value position of the slider. By default this is set to 0, so the initial position will be at 0. You can set this value to any integer within the range of the Maximum Value and Minimum Value attribute settings.
In the generated *.pro file, this value is specified with the VALUE keyword to the widget creation routine.
The Suppress Value attribute controls the display of the current slider value. Sliders work only with integer units. You can use this attribute to suppress the actual value of a slider so that a program can present the user with a slider that seems to work in other units (such as floating-point) or with a non-linear scale. By default, this value is set to False, indicating that the current value, in integer units, should be displayed. To suppress the display of the current values, set this attribute value to True.
In the generated *.pro file, this value is specified with the SUPPRESS_VALUE keyword to the widget creation routine.
The Tab Mode attribute specifies what support the widget has for receiving or losing focus through tabbing. By default, this value is set to Inherit.
| Note It is not possible to tab to disabled (Sensitive = False) or hidden (Visible = False) widgets. |
Allowable values are:
| Note The default tab mode of a widget is Inherit. The tabbing support defined for the parent base, described in Base Widget Attributes, is inherited by widget children unless otherwise specified. |
| Note In widget applications on the UNIX platform, the Motif library controls what widgets are brought into and released from focus using tabbing. The TAB_MODE keyword value is always zero, and any attempt to change it is ignored when running a widget application on the UNIX platform. Tabbing behavior may vary significantly between UNIX platforms; do not rely on a particular behavior being duplicated on all UNIX systems. |
In the generated *.pro file, this value is specified with the TAB_MODE keyword to the widget creation routine. For more information on tabbing among widgets, see Tabbing in Widget Applications.
The Title attribute specifies the label or title that is associate with the slider widget. By default, this is not set; it is an empty string. You can set the title to any string.
In the generated *.pro file, this value is specified with the TITLE keyword to the widget creation routine.
For slider widgets, you can set common event properties and slider-specific event properties. By default, event values are not set. For a list of events common to all widgets, see Common Events.
This is the event property specific to slider widgets:
The OnChangeValue specifies the routine that is called when the value of the slider is changed. When you set this event value, the calling sequence looks like this in the generated *_eventcb.pro file:
pro <RoutineName>, Event
where RoutineName is the name of the event procedure you specify. Event is the event structure returned when a slider is moved.
The event structure is of the following type:
{ WIDGET_SLIDER, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0 }
VALUE returns the new value of the slider. DRAG returns integer 1 if the slider event was generated as part of a drag operation, or zero if the event was generated when the user had finished positioning the slider. Note that the slider widget only generates events during the drag operation if the DRAG keyword is set. That is, in most cases, DRAG will return zero.
IDL Online Help (March 06, 2007)