XmScale(3Xm) XmScale(3Xm)
NAME
XmScale - the Scale widget class.
AES SUPPORT LEVEL
full-use
SYNOPSIS
#include <Xm/Scale.h>
DESCRIPTION
Scale is used by an application to indicate a value
from within a range of values, and it allows the user
to input or modify a value from the same range.
A Scale has an elongated rectangular region similar to
a ScrollBar. Inside this region, is a slider which
indicates the current value along the Scale. The user
can also modify the Scale's value by moving the slider
within the rectangular region of the Scale. A Scale
can also include a label set located outside the Scale
region. These can indicate the relative value at
various positions along the scale.
A Scale can be either input/output or output only. An
input/output Scale's value can be set by the
application and also modified by the user by using the
slider. An output-only Scale is used strictly as an
indicator of the current value of something and cannot
be modified interactively by the user. The Core
resource XmNsensitive specifies whether or not the user
can interactively modify the Scale's value.
Classes
Scale inherits behavior and resources from Core,
Composite, Constraint, and XmManager classes.
The class pointer is xmScaleWidgetClass.
The class name is XmScale.
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 or XmC prefix and use
the remaining letters. To specify one of the defined
- 1 -
XmScale(3Xm) XmScale(3Xm)
values for a resource in a .Xdefaults file, remove the
Xm prefix and use the remaining letters (in either
lower case or upper case, 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).
XmScale Resource Set
Name Class Type Default Access
_________________________________________________________________________________________
XmNdecimalPoints XmCDecimalPoints short 0 CSG
XmNdragCallback XmCCallback XtCallbackList NULL C
XmNfontList XmCFontList XmFontList "Fixed" CSG
XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG
XmNhighlightThickness XmCHighlightThickness short 0 CSG
XmNmaximum XmCMaximum int 100 CSG
XmNminimum XmCMinimum int 0 CSG
XmNorientation XmCOrientation unsigned char XmVERTICAL CSG
XmNprocessingDirection XmCProcessingDirection unsigned char XmMAX_ON_TOP CSG
XmNscaleHeight XmCScaleHeight Dimension 0 CSG
XmNscaleWidth XmCScaleWidth Dimension 0 CSG
XmNshowValue XmCShowValue Boolean False CSG
XmNtitleString XmCTitleString XmString NULL CSG
XmNtraversalOn XmCTraversalOn Boolean False CSG
XmNvalue XmCValue int 0 CSG
XmNvalueChangedCallback XmCCallback XtCallbackList NULL C
XmNdecimalPoints
Specifies the number of decimal points to shift
the slider value when displaying it. For example,
a slider value of 2,350 and an XmdecimalPoints
value of 2 would result in a display value of
23.50.
XmNdragCallback
Specifies the list of callbacks that is called
when the slider position changes as the slider is
being dragged. The reason sent by the callback is
XmCR_DRAG.
XmNfontList
Specifies the font list to use for the title text
string specified by XmNtitleString.
XmNhighlightOnEnter
Specifies whether to draw the slider's border
highlight on enter window events. This resource
is ignored if the XmNtraversalOn resource is set
to True.
- 2 -
XmScale(3Xm) XmScale(3Xm)
XmNhighlightThickness
Specifies the size of the slider's border drawing
rectangle used for enter window and traversal
highlight drawing.
XmNmaximum
Specifies the slider's maximum value.
XmNminimum
Specifies the slider's minimum value.
XmNorientation
Displays Scale vertically or horizontally. This
resource can have values of XmVERTICAL and
XmHORIZONTAL.
XmNprocessingDirection
Specifies whether the value for XmNmaximum is on
the right or left side of XmNminimum for
horizontal Scales or above or below XmNminimum for
vertical Scales. This resource can have values of
XmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT, and
XmMAX_ON_RIGHT.
XmNscaleHeight
Specifies the height of the slider area. The
value should be in the specified unit type
(default is pixels).
XmNscaleWidth
Specifies the width of the slider area. The value
should be in the specified unit type (default is
pixels).
XmNshowValue
Specifies if a label for the current slider value
should be displayed next to the slider. If it is
True, the current slider value is displayed.
XmNtitleString
Specifies the title text string to appear in the
scale widget window.
XmNtraversalOn
Specifies whether the Scale's slider is to have
traversal on for it.
XmNvalue
Specifies the slider's current position along the
scale, between minimum and maximum.
XmNvalueChangedCallback
- 3 -
XmScale(3Xm) XmScale(3Xm)
Specifies the list of callbacks that is called
when the value of the slider has changed. The
reason sent by the callback is XmCR_VALUE_CHANGED.
Inherited Resources
Scale inherits behavior and resources from the
following superclasses. For a complete description of
these resources, refer to the man page for that
superclass.
XmManager Resource Set
Name Class Type Default Access
______________________________________________________________________________________________
XmNbottomShadowColor XmCForeground Pixel dynamic CSG
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNforeground XmCForeground Pixel dynamic CSG
XmNhelpCallback XmCCallback XtCallbackList NULL C
XmNhighlightColor XmCForeground Pixel Black CSG
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
XmNshadowThickness XmCShadowThickness short 0 N/A
XmNtopShadowColor XmCBackground Pixel dynamic CSG
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNuserData XmCUserData caddr_t NULL CSG
Composite Resource Set
Name Class Type Default Access
______________________________________________________________________
XmNinsertPosition XmCInsertPosition XmRFunction NULL CSG
Core Resource Set
Name Class Type Default Access
____________________________________________________________________________________________
XmNaccelerators XmCAccelerators XtTranslations NULL CSG
XmNancestorSensitive XmCSensitive Boolean True G
XmNbackground XmCBackground Pixel dynamic CSG
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderColor XmCBorderColor Pixel Black CSG
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderWidth XmCBorderWidth Dimension 0 CSG
XmNcolormap XmCColormap Colormap XtCopyFromParent CG
XmNdepth XmCDepth int XtCopyFromParent CG
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNheight XmCHeight Dimension 0 CSG
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
XmNscreen XmCScreen Pointer XtCopyScreen CG
XmNsensitive XmCSensitive Boolean True CSG
XmNtranslations XmCTranslations XtTranslations NULL CSG
XmNwidth XmCWidth Dimension 0 CSG
- 4 -
XmScale(3Xm) XmScale(3Xm)
XmNx XmCPosition Position 0 CSG
XmNy XmCPosition Position 0 CSG
Callback Information
The following structure is returned with each callback.
typedef struct
{
int reason;
XEvent * event;
int value;
} XmScaleCallbackStruct;
reason Indicates why the callback was invoked.
event Points to the XEvent that triggered the
callback.
value Is the new slider location value.
Behavior
<Btn1Down>:
Activates the interactive dragging of the slider
if the button is pressed anywhere inside of the
scale rectangle, including the slider.
Button1<PtrMoved>:
Moves the slider to the new position and calls the
callbacks for XmNdragCallback if the button press
occurs within the slider.
<Btn1Up>:
Calls the callbacks for XmNvalueChangedCallback if
the button press occurs within the scale rectangle
and if the slider position was changed.
Default Translations
The following are Scale's default translations:
<Btn1Down>: Arm()
<Btn1Up>: Activate()
<EnterWindow>: Enter()
<FocusIn>: FocusIn()
Keyboard Traversal
For information on keyboard traversal, see the man page
for XmManager(3X) and its sections on behavior and
- 5 -
XmScale(3Xm) XmScale(3Xm)
default translations.
RELATED INFORMATION
Composite(3X), Constraint(3X), Core(3X),
XmCreateScale(3X), XmManager(3X), XmScaleGetValue(3X),
and XmScaleSetValue(3X).
- 6 -