SLIDER WIDGET(3W) MISC. REFERENCE MANUAL PAGES SLIDER WIDGET(3W)
WIDGET CLASS NAME
Slider
SYNOPSIS
#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <Slider.h>
widget = XtCreateWidget(name, sliderWidgetClass, ...)
DESCRIPTION
Slider Components The Slider widget implements a simple con-
trol used to change a numeric value. It consists of the
following elements:
- Top (Left) Anchor
- Bottom (Right) Anchor
- Drag Box
- Bar (typically)
- Shaded Bar (typically)
- Current Value (not visible)
- Minimum Value (not visible)
- Maximum Value (not visible) The Current Value is the
numeric value a user attempts to change with the Slider
widget.
Amiga Unix Last change: 1
SLIDER WIDGET(3W) MISC. REFERENCE MANUAL PAGES SLIDER WIDGET(3W)
Figure 1. Horizontal Slider
Figure 2. Vertical Slider
Drag Box Motion As visual feedback to the user, the Drag
Box moves up or down (or left or right) along the Bar as
the Current Value changes.
Dragging SELECT The user can change the Current Value by
dragging the Drag Box with SELECT. The pressing of SELECT
must start with the pointer in the Drag Box, but the Drag
Box (and the Current Value) track the pointer motion
regardless of where it goes while SELECT is pressed. This
means it is not possible for the user to change the
Current Value by first pressing SELECT outside the Drag
Box and then moving the pointer into it. Only the com-
ponent of the pointer motion parallel to the Bar is
tracked, and the motion of the Drag Box (and change in the
Current Value) are limited by the length of the Bar.
Clicking SELECT Clicking SELECT above the Drag Box for a
vertical slider, or to the right for a horizontal slider,
increases the Current Value by an application-specified
amount, moves the Drag Box to correspond to the new
Current Value, and moves the pointer to keep it on the
Drag Box. Clicking SELECT to the other side of the Drag
Box decreases the value by the same amount and moves the
Drag Box and pointer accordingly. Pressing SELECT repeats
this action.
Moving Drag Box to Limits Clicking SELECT on one of the
Bottom/Left or Top/Right Anchors causes the Current Value
to take on the Minimum Value or Maximum Value, respec-
tively, and moves the Drag Box to the limit in the direc-
tion of the Anchor. If the Drag Box is already at the
limit, nothing happens. Clicking SELECT on an Anchor
highlights the Anchor while the Current Value is changed.
Application Notification The application finds out about a
change in the Current Value on the release of SELECT for
either the drag or click. It is responsible for providing
any feedback to the end user deemed appropriate, such as
updating the Current Value in a text field.
Slider Coloration Figure 3 illustrates the resources that
affect the coloration of the Slider widget.
Amiga Unix Last change: 2
SLIDER WIDGET(3W) MISC. REFERENCE MANUAL PAGES SLIDER WIDGET(3W)
Figure 3. Slider Coloration
Amiga Unix Last change: 3
SLIDER WIDGET(3W) MISC. REFERENCE MANUAL PAGES SLIDER WIDGET(3W)
RESOURCES
______________________________________________________________________________________
______________________________Slider_Resource_Set\*(cO________________________________
Name Class Type Default Access
______________________________________________________________________________________
Amiga Unix Last change: 4
() MISC. REFERENCE MANUAL PAGES ()
______________________________________________________________________________________
_XtNancestorSensitive___XtCSenstitive__________Boolean__________TRUE___________G*_____
| XtNbackground XtCBackground Pixel White SGI† |
|_____________________|______________________|________________|______________|________|
|_XtNbackgroundPixmap_|__XtCPixmap___________|__Pixmap________|__(none)______|__SGI†__|
| XtNdepth | XtCDepth | int | (parent's) | GI |
|_____________________|______________________|________________|______________|________|
|_XtNdestroyCallback__|__XtCCallback_________|__XtCallbackList|__NULL________|__SI____|
| XtNforeground | XtCForeground | Pixel | Black | SGI† |
|_____________________|______________________|________________|______________|________|
|_XtNgranularity______|__XtCGranularity______|__int___________|__1___________|__SGI___|
| XtNheight | XtCHeight | Dimension | (calculated)| SGI |
|_____________________|______________________|________________|______________|________|
|_XtNinitialDelay_____|__XtCInitialDelay_____|__int___________|__500_________|__SGI___|
| XtNmappedWhenManaged| XtCMappedWhenManaged| Boolean | TRUE | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNorientation______|__XtCOrientation______|__OlDefine______|__OL_VERTICAL_|__I_____|
| XtNrepeatRate | XtCRepeatRate | int | 100 | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNsensitive________|__XtCSensitive________|__Boolean_______|__TRUE________|__GI*___|
| XtNsliderMax | XtCSliderMax | int | 100 | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNsliderMin________|__XtCSliderMax________|__int___________|__0___________|__SGI___|
| XtNsliderMoved | XtCCallback | XtCallbackList| NULL | SI |
|_____________________|______________________|________________|______________|________|
|_XtNsliderValue______|__XtCSliderValue______|__int___________|__0___________|__SGI___|
| XtNuserData | XtCUserData | XtPointer | NULL | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNwidth____________|__XtCWidth____________|__Dimension_____|__(calculated)|__SGI___|
| XtNx | XtCPosition | Position | 0 | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNy________________|__XtCPosition_________|__Position______|__0___________|__SGI___|
XtNforeground This resource defines the foreground color for
the widget. See the note about the interaction of this
resource with other color resources under the description of
the XtNbackground resource in CORE(3W).
XtNgranularity
Range of Values:
1 _ XtNgranularity _ (XtNsliderMax - XtNsliderMin)
Clicking SELECT on the Bar or Shaded Bar attempts to change
the Current Value by the amount given in this resource.
Dragging the Drag Box with SELECT changes the Current Value
by this amount before the XtNsliderMoved callbacks are
issued.
XtNinitialDelay
Range of Values:
0 < XtNinitialDelay
Amiga Unix Last change: 1
() MISC. REFERENCE MANUAL PAGES ()
This resource gives the time, in milliseconds, before the
first action occurs when SELECT is pressed on the Bar or
Shaded Bar. Note that millisecond timing precision may not
be possible for all implementations, so the value may be
rounded up to the nearest available unit by the toolkit.
XtNorientation
Range of Values:
OL_HORIZONTAL/"horizontal"
OL_VERTICAL/"vertical"
This resource defines the direction for the visual presenta-
tion of the widget.
XtNrepeatRate
Range of Values:
0 < XtNrepeatRate
This resource gives the time, in milliseconds, between
repeated actions when SELECT is pressed on the Bar or Shaded
Bar. Note that millisecond timing precision may not be pos-
sible for all implementations, so the value may be rounded
up to the nearest available unit by the toolkit.
XtNsliderMax
XtNsliderMin
Range of Values:
XtNsliderMin < XtNsliderMax
These two resources give the range of values tracked by the
Slider widget. Mathematically, the range is open on the
right; that is, the range is the following subset of the set
of integers:
XtNsliderMin _ range _ XtNsliderMax
This is independent of the Drag Box displayed in the Slider
widget. The Slider widget is responsible for taking into
account the size of the Drag Box when relating the physical
range of movement to the range of values.
Amiga Unix Last change: 2
() MISC. REFERENCE MANUAL PAGES ()
Figure 4. Drag Box Range of Movement
XtNsliderMoved This resource defines the callback list used
when the Slider widget is manipulated. The call_data param-
eter is a pointer to the Current Value; an XtGetValue()
inside the callback will return the previous value.
XtNsliderValue Range of Values:
XtNsliderMin _ XtNsliderValue _ XtNsliderMax
This resource gives the current position of the Drag Box, in
the range [ XtNsliderMin , XtNsliderMax ]. The Slider
widget keeps this resource up to date; however, an applica-
tion can also get the current value through the XtNslider-
Moved callbacks.
Amiga Unix Last change: 3