Gauge(3W) UNIX System V Gauge(3W)
NAME
Gauge - the graphical equivalent of a read only analog control
SYNOPSIS
#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <Gauge.h>
widget = XtCreateWidget(name, gaugeWidgetClass, ...)
DESCRIPTION
Gauge Components
The Gauge widget is merely an indicator of amount of space available in
any container it is measuring.
It consists of the following elements:
- Bar (typically)
- Shaded Bar (typically)
- Current Value (not visible)
- Minimum Value (not visible)
- Maximum Value (not visible)
Figure 1. Horizontal Gauge Widget
Application Notification
The application is responsible for providing any feedback to the end user
deemed appropriate, such as updating the Current Value in a text field.
RESOURCES
____________________________________________________________________________________________
| Gauge Resource Set |
|_____________________|______________________|________________|____________________|________|
| Name | Class | Type | Default | Access|
|_____________________|______________________|________________|____________________|________|
____________________________________________________________________________________________
XtNancestorSensitive XtCSenstitive Boolean TRUE G*
____________________________________________________________________________________________
XtNaccelerator XtCAccelerator String NULL SGI
____________________________________________________________________________________________
XtNacceleratorText XtCAcceleratorText String Dynamic SGI
____________________________________________________________________________________________
XtNbackground XtCBackground Pixel White SGI†
____________________________________________________________________________________________
XtNbackgroundPixmap XtCPixmap Pixmap (none) SGI†
____________________________________________________________________________________________
XtNconsumeEvent XtCConsumeEvent XtCallbackList NULL SGI
10/89 Page 1
Gauge(3W) UNIX System V Gauge(3W)
____________________________________________________________________________________________
| Gauge Resource Set (cont'd) |
|_____________________|______________________|________________|____________________|________|
| Name | Class | Type | Default | Access|
|_____________________|______________________|________________|____________________|________|
____________________________________________________________________________________________
XtNdestroyCallback XtCCallback XtCallbackList NULL SI
____________________________________________________________________________________________
XtNfont XtCFont FontStruct * (OPENLOOK default) SGI
____________________________________________________________________________________________
XtNfontColor XtCFontColor Pixel foreground SGI
____________________________________________________________________________________________
XtNforeground XtCForeground Pixel Black SGI†
____________________________________________________________________________________________
XtNheight XtCHeight Dimension (calculated) SGI
____________________________________________________________________________________________
XtNgranularity XtCGranularity int 1 SGI
____________________________________________________________________________________________
XtNinputFocusColor XtCInputFocusColor Pixel Black SGI
____________________________________________________________________________________________
XtNmappedWhenManaged XtCMappedWhenManaged Boolean TRUE SGI
____________________________________________________________________________________________
XtNminLabel XtCLabel String NULL SGI
____________________________________________________________________________________________
XtNmaxLabel XtCLabel String NULL SGI
____________________________________________________________________________________________
XtNmnemonic XtCMnemonic unsigned char NULL SGI
____________________________________________________________________________________________
XtNorientation XtCOrientation OlDefine OL_VERTICAL GI
____________________________________________________________________________________________
XtNrecomputeSize XtCRecomputeSize Boolean FALSE SGI
____________________________________________________________________________________________
XtNreferenceName XtCReferenceName String NULL SGI
____________________________________________________________________________________________
XtNreferenceWidget XtCReferenceWidget Widget NULL SGI
____________________________________________________________________________________________
XtNsensitive XtCSensitive Boolean TRUE GI*
____________________________________________________________________________________________
XtNsliderMax XtCSliderMax int 100 SGI
____________________________________________________________________________________________
XtNsliderMin XtCSliderMax int 0 SGI
____________________________________________________________________________________________
XtNsliderValue XtCSliderValue int 0 SGI
____________________________________________________________________________________________
XtNspan XtCSpan Dimension OL_IGNORE SGI
____________________________________________________________________________________________
XtNticks XtCTicks int 0 SGI
____________________________________________________________________________________________
XtNtickUnit XtCTickUnit OlDefine OL_NONE SGI
____________________________________________________________________________________________
XtNtraversalOn XtCTraversalOn Boolean TRUE SGI
____________________________________________________________________________________________
Page 2 10/89
Gauge(3W) UNIX System V Gauge(3W)
____________________________________________________________________________________________
| Gauge Resource Set (cont'd) |
|_____________________|______________________|________________|____________________|________|
| Name | Class | Type | Default | Access|
|_____________________|______________________|________________|____________________|________|
| 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
Resources, Section 2.
XtNminLabel
This is the label to be placed next to the minimum value position. For a
vertical gauge, the label is placed to the right of the minimum value
position. If there is not enough space for the entire label and
XtNrecomputeSize is FALSE, the label will be truncated from the end. If
there is not enough space for the entire label and XtNrecomputeSize is
TRUE, then the widget will request for more space to show the entire
label.
For an horizontal gauge, the label is placed centered and below the
minimum value position. If there is not enough room to center the label
and XtNrecomputeSize is set to FALSE, the beginning of the label will be
aligned with the left anchor and is drawn to the right. If this label
collides with the max label, some part of the labels will overlap. If
there is not enough room to center the label and XtNrecomputeSize is set
to TRUE, the widget will request for more space to center the label below
the minimum value position.
XtNmaxLabel
This is the label to be placed next to the maximum value position. For a
vertical gauge, the label is placed to the right of the minimum value
position. If there is not enough space for the entire label and
XtNrecomputeSize is FALSE, the label will be truncated from the end. If
there is not enough space for the entire label and XtNrecomputeSize is
TRUE, then the widget will request for more space to show the entire
label.
For an horizontal gauge, the label is placed centered and below the
maximum value position. If there is not enough room to center the label
10/89 Page 3
Gauge(3W) UNIX System V Gauge(3W)
and XtNrecomputeSize is set to FALSE, the end of the label will be
aligned with the left anchor. If this label collides with the min label,
some part of the labels will overlap. If there is not enough room to
center the label and XtNrecomputeSize is set to TRUE, the widget will
request for more space to center the label below the maximum value
position.
XtNorientation
Range of Values:
OLHORIZONTAL/"horizontal"
OLVERTICAL/"vertical"
This resource defines the direction for the visual presentation of the
widget.
XtNsliderMax
XtNsliderMin
Range of Values:
XtNsliderMin < XtNsliderMax
These two resources give the range of values tracked by the Gauge 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
XtNsliderValue
Range of Values:
XtNsliderMin < XtNsliderValue < XtNsliderMax
This resource gives the current position of the Drag Box, in the range [
XtNsliderMin , XtNsliderMax ]. The Gauge widget keeps this resource up
to date.
XtNticks
This is the interval between tick marks. The unit of the interval value
is determined by XtNtickUnit.
XtNtickUnit
Range of values:
OL_NONE/"none"
OL_SLIDERVALUE/"slidervalue"
OL_PERCENT/"percent"
This resource can have one of the values: OL_NONE, OL_SLIDERVALUE, and
OL_PERCENT. If it is OL_NONE, then no tick marks will be displayed and
XtNticks is ignored. If it is OL_PERCENT, then XtNticks is interpreted as
the percent of the gauge value range. If it is OL_SLIDERVALUE, the
XtNticks is interpreted as the same unit as gauge value.
Page 4 10/89
Gauge(3W) UNIX System V Gauge(3W)
Note: To be consistent with the scrollbar widget, we recommend that the
effective spacing between tick marks, designated in XtNticks and
XtNtickUnit be less than or equal to the spacing in XtNgranularity.
Figure 2. Gauge Widget with Tick Marks
XtNrecomputeSize
This resource, if set to TRUE, allows the gauge widget to resize itself
whenever needed, to compensate for the space needed to show the tick
marks and the labels. The gauge widget uses the XtNspan, the sizes of the
labels, and XtNtickUnit to determine the preferred size.
XtNfont
This resource specifies the font used to draw the labels. It defaults to
the OPENLOOK standard font.
XtNfontcolor
This resource specifies the color used to draw the labels. It defaults to
the foreground color of the gauge widget.
XtNspan
If XtNrecomputeSize is set to TRUE, then XtNspan should be set to reflect
the preferred length of the gauge, not counting the space needed for the
labels. The gauge widget uses the span value, the sizes of the labels,
and XtNtickUnit to determine the preferred size.
10/89 Page 5