'\"!  tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | eqn | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | eqn | tbl | tbl | mmdoc
'\"macro stdmacro
.if n .pH g3w.olSlider @(#)olSlider	40.3 of 1/8/90
.SO BP.HEADER \" This header enables use of .BP macro for PostScript graphics
.ig
Modified 10/18/89 by lmh
..
.ds cW SLIDER
.ds rW Slider
.ds nW Slider
.ds wW slider
.ds bW \fB\*(rW\fP
.ds iW \fI\*(rW\fP
.ds oS \*(cW
.nr oN 0
.nr X
.if \nX=0 .ds x} ""SLIDER WIDGET" 3W "\&"
.if \nX=1 .ds x} ""SLIDER WIDGET" 3W
.if \nX=2 .ds x} ""SLIDER WIDGET" "" "\&"
.if \nX=3 .ds x} ""SLIDER "" "" "\&"
.TH \*(x}
.SH "WIDGET CLASS NAME"
\*(bW
.SH "SYNOPSIS"
.nf
\s-1\f4#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <\*(nW.h>\f1\s+1\f1
.fi
.P
.nf
\s-1\f4widget = XtCreateWidget(\f2name\f4, \*(wWWidgetClass, ...)\f1\s+1
.fi
.SH "DESCRIPTION"
.sp
\f3\*(rW Components\f1
.P
The \*(bW widget implements a simple control used to change a
numeric value.
It consists of the following elements:
.IP \(em 1.5P
Top (Left) Anchor
.IP \(em 1.5P
Bottom (Right) Anchor
.IP \(em 1.5P
Drag Box
.IP \(em 1.5P
Bar (typically)
.IP \(em 1.5P
Shaded Bar (typically)
.IP \(em 1.5P
Current Value (not visible)
.IP \(em 1.5P
Minimum Value (not visible)
.IP \(em 1.5P
Maximum Value (not visible)
.P
The Current Value is the numeric value a user attempts to
change with the \*(bW widget.
.br
.ne 3.5i
.BP PSART/ps.slider1
.P
.ce
\f3Figure 1.\f1  Horizontal Slider
.br
.ne 3.5i
.BP PSART/ps.slider2
.P
.ce
\f3Figure 2.\f1  Vertical Slider 
.sp
\f3Drag Box Motion\f1
.P
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.
.sp
\f3Dragging SELECT\f1
.P
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 component 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.
.sp
\f3Clicking SELECT\f1
.P
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.
.sp
\f3Moving Drag Box to Limits\f1
.P
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,
respectively,
and moves the Drag Box to the limit in the direction of the
Anchor.
If the Drag Box is already at the limit,
nothing happens.
.P
Clicking SELECT on an Anchor highlights the Anchor while the
Current Value is changed.
.sp
\f3Application Notification\f1
.P
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.
.sp
\f3\*(rW Coloration\f1
.P
Figure 3 illustrates the resources that affect the coloration
of the \*(bW widget.
.br
.ne 3.5i
.BP PSART/ps.slider3
.P
.ce
\f3Figure 3.\f1  Slider Coloration
.bp
.SH "RESOURCES"
.ds cO
.TS H
allbox;
cB s s s s.
\*(bW Resource Set\\\\*(cO
.T&
lBp-2 lBp-2 lBp-2 lBp-2 lBp-2.
Name	Class	Type	Default	Access
_
.TH
.ds cO " (cont'd)
.T&
lp-2 lp-2 lp-2 lp-2 lp-2.
XtNancestorSensitive	XtCSenstitive	Boolean	TRUE	G*
XtNbackground	XtCBackground	Pixel	White	SGI\(dg
XtNbackgroundPixmap	XtCPixmap	Pixmap	(none)	SGI\(dg
XtNdepth	XtCDepth	int	(parent's)	GI
XtNdestroyCallback	XtCCallback	XtCallbackList	NULL	SI
XtNforeground	XtCForeground	Pixel	Black	SGI\(dg
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
.TE
\f3XtNforeground\f1
.P
This resource defines the foreground color for the widget.
.P
See the note about the interaction of this resource with other
color resources under the description of the
\f4XtNbackground\f1
resource in \f3CORE(3W)\f1.
.sp
\f3XtNgranularity\f1
.PP
Range of Values:
.br
.in +5
\f41 \(<= XtNgranularity \(<= (XtNsliderMax - XtNsliderMin)\f1
.in -5
.fi
.PP
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
\f4XtNsliderMoved\f1
callbacks are issued.
.sp
\f3XtNinitialDelay\f1
.PP
Range of Values:
.br
.in +5
.nf
\f40 < XtNinitialDelay\f1
.in -5
.fi
.PP
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.
.sp
\f3XtNorientation\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4OL_HORIZONTAL/"horizontal"
OL_VERTICAL/"vertical"\f1
.in -5
.fi
.PP
This resource defines the direction for the visual presentation
of the widget.
.sp 0.75
\f3XtNrepeatRate\f1
.PP
Range of Values:
.br
.in +5
.nf
\f40 < XtNrepeatRate\f1
.in -5
.fi
.PP
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 possible
for all implementations,
so the value may be rounded up to the nearest available unit by
the toolkit.
.sp 0.75
\f3XtNsliderMax\f1
.br
.br
\f3XtNsliderMin\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4XtNsliderMin < XtNsliderMax\f1
.in -5
.fi
.PP
These two resources give the range of values tracked by the
\*(bW widget.
Mathematically, the range is open on the right;
that is,
the range is the following subset of the set of integers:
.sp 0.25
.ce
\f4XtNsliderMin \(<= \f1range\f4 \(<= XtNsliderMax\f1
.P
This is independent of the Drag Box displayed in the \*(bW
widget.
The \*(bW 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.
.br
.ne 3.5i
.BP PSART/ps.slider4
.P
.ce
\f3Figure 4.\f1  Drag Box Range of Movement
.sp
\f3XtNsliderMoved\f1
.P
This resource defines the callback list used when the \*(bW widget
is manipulated.
The
\f4call_data\f1
parameter is a pointer to the Current Value;
an \f(CWXtGetValue()\fP inside the callback will return the previous
value.
.sp
\f3XtNsliderValue\f1
.P
Range of Values:
.br
.in +5
.nf
\f4XtNsliderMin \(<= XtNsliderValue \(<= XtNsliderMax\f1
.fi
.in -5
.P
This resource gives the current position of the Drag Box,
in the range 
[\f4\| XtNsliderMin ,\| XtNsliderMax \|]\f1.
The \*(bW widget keeps this resource up to date;
however,
an application can also get the current value through the
\f4XtNsliderMoved\f1
callbacks.
