Dial(3X) UNIX System V Dial(3X)
NAME
SgDial - The Dial widget class
SYNOPSIS
#include <Sgm/Dial.h>
VERSION
This page documents the version of Sgm that accompanies
Motif 1.2.
DESCRIPTION
Dial is used by an application to allow the user to input or
modify a value from within a range of values.
A Dial has a rectangular region within which a knob or
pointer graphic is displayed. The user can modify the
Dial's value by spinning this knob or pointer.
Classes
Dial inherits behavior and resources from Core and Primitive
classes.
The class pointer is sgDialWidgetClass.
The class name is SgDial.
New Resources
The following table defines a set of widget resources used
by the programmer to specify data. The programmer can also
set the resource values for the inherited classes to set
attributes for this widget. To reference a resource by name
or by class in a .Xdefaults file, remove the XmN, SgN, XmC,
or SgC prefix and use the remaining letters. To specify one
of the defined values for a resource in a .Xdefaults file,
remove the Xm prefix and use the remaining letters (in
either lowercase or uppercase, but include any underscores
between words). The codes in the access column indicate if
the given resource can be set at creation time (C), set by
using XtSetValues (S), retrieved by using XtGetValues (G),
or is not applicable (N/A).
SgDial Resource Set
Name Class Type Default Access
___________________________________________________________________________
SgNdialMarkers SgCMarkers int 16 CSG
XmNminimum XmCMinimum int 0 CSG
XmNmaximum XmCMaximum int 360 CSG
SgNstartAngle SgCStartAngle int 0 CSG
SgNangleRange SgCAngleRange int 360 CSG
Page 1 (printed 4/30/98)
Dial(3X) UNIX System V Dial(3X)
SgNindicatorColor XmCColor Pixel Red CSG
XmNvalue XmCValue Position 0 CSG
SgNmarkerLength XmCLength Dimension 8 CSG
SgNdialForeground SgCForeground Pixel Red CSG
SgNdialVisual SgCDialVisual SgDialVisual SgKNOB CSG
XmNvalueChangedCallback XmCCallback XtCallbackList NULL C
XmNdragCallback XmCCallback XtCallbackList NULL C
SgNdialMarkers
Specifies the number of divisions around the
perimeter of the dial. A "tick mark" will be
drawn at each division, filled with the color set
by SgNdialForeground.
XmNmaximum
Specifies the dial's maximum value. XmNmaximum
must be greater than or equal to XmNminimum.
XmNminimum
Specifies the dial's minimum value. XmNmaximum
must be greater than or equal to XmNminimum.
SgNstartAngle
Specifies the whole number angle (0-360) where the
dial will start increasing.
SgNangleRange
Specifies the angular range, in degrees, through
which the dial is allowed to rotate. This, in
conjunction with XmNmaximum and XmNminimum,
controls the fineness or coarseness of the dial
control.
SgNindicatorColor
Specifies the color to be used for filling in the
center of the dial pointer, in SgPOINTER mode.
XmNvalue Specifies the current position of the dial,
between XmNminimum and XmNmaximum.
SgNmarkerLength
Specifies the length (in pixels) of each tick mark
on the dial. The width of each tick mark is
derived from the length (length/3).
SgNdialForeground
Specifies the color to be used for filling in the
tick marks around the perimeter of the dial.
SgNdialVisual
Specifies the look of the dial, either SgKNOB or
Page 2 (printed 4/30/98)
Dial(3X) UNIX System V Dial(3X)
SgPOINTER.
XmNvalueChangedCallback
Specifies the list of callbacks that is called
when the value of the dial has changed. The
reason sent by the callback is XmCRVALUECHANGED.
XmNdragCallback
Specifies the list of callbacks that is called
when the dial position changes as the dial is
being spun. The reason sent by the callback is
XmCRDRAG.
Inherited Resources
Dial inherits behavior and resources from the following
superclasses. For a complete description of each resource,
refer to the man page for that superclass.
XmPrimitive Resource Set
Name Class Type Default Access
________________________________________________________________________________________________
XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNforeground XmCForeground Pixel dynamic CSG
XmNhelpCallback XmCCallback XtCallbackList NULL C
XmNhighlightColor XmCHighlightColor Pixel dynamic CSG
XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
XmNhighlightThickness XmCHighlightThickness Dimension 0 CSG
XmNnavigationType XmCNavigationType XmNavigationType XmNONE CSG
XmNshadowThickness XmCShadowThickness Dimension 0 CSG
XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG
XmNtraversalOn XmCTraversalOn Boolean False CSG
XmNunitType XmCUnitType unsigned char dynamic CSG
XmNuserData XmCUserData XtPointer NULL CSG
Core Resource Set
Name Class Type Default Access
______________________________________________________________________________________________________________
XmNaccelerators XmCAccelerators XtAccelerators dynamic CSG
XmNancestorSensitive XmCSensitive Boolean dynamic G
XmNbackground XmCBackground Pixel dynamic CSG
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderWidth XmCBorderWidth Dimension 0 CSG
XmNcolormap XmCColormap Colormap dynamic CG
XmNdepth XmCDepth int dynamic CG
Page 3 (printed 4/30/98)
Dial(3X) UNIX System V Dial(3X)
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNheight XmCHeight Dimension dynamic CSG
XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
XmNscreen XmCScreen Screen * dynamic CG
XmNsensitive XmCSensitive Boolean True CSG
XmNtranslations XmCTranslations XtTranslations dynamic CSG
XmNwidth XmCWidth Dimension dynamic CSG
XmNx XmCPosition Position 0 CSG
XmNy XmCPosition Position 0 CSG
Callback Information
A pointer to the following structure is passed to each
callback:
typedef struct
{
int reason;
XEvent * event;
int position;
} SgDialCallbackStruct;
reason Indicates why the callback was invoked
event Points to the XEvent that triggered the callback
position
Is the new dial value
Behavior
Dial behavior is described below:
BSelect Press or BDrag Press:
Activates the interactive dragging of the dial.
BSelect Motion or BDrag Motion:
Motion events spin the dial to follow the motion
of the pointer and call the callbacks for
XmNdragCallback.
BSelect Release or BDrag Release:
If the dial position has changed, the callbacks
for XmNvalueChangedCallback are called.
Virtual Bindings
The bindings for virtual keys are vendor specific. For
information about bindings for virtual buttons and keys, see
VirtualBindings(3X).
Page 4 (printed 4/30/98)
Dial(3X) UNIX System V Dial(3X)
RELATED INFORMATION
Primitive(3X), Core(3X)
Page 5 (printed 4/30/98)