Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Gauge(3w) — unbundled OpenWindows_3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Gauge(3w)  —  OLIT Widget Set

NAME

Gauge − a read-only, analog display widget

SYNOPSIS

#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xol/OpenLook.h>
#include <Xol/Gauge.h>
 . . .
Widget my_gauge, my_parent;
String my_name;
ArgList args;
Cardinal num_args;

my_gauge =  XtCreate( my_name, gaugeWidgetClass,

my_parent, args, num_args);

DESCRIPTION

Components

The Gauge widget indicates of the 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

  Figure 2 Vertical Gauge

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                 Type           Default             Access
 
XtNancestorSensitive Boolean        TRUE                G∗
XtNaccelerator       String         NULL                SGI
XtNacceleratorText   String         Dynamic             SGI
XtNbackground        Pixel          XtDefaultBackground SGI
XtNbackgroundPixmap  Pixmap         (none)              SGI
XtNconsumeEvent      XtCallbackList NULL                SGI
XtNdestroyCallback   XtCallbackList NULL                SI
XtNfont              FontStruct     ∗                   (OPENLOOK
XtNfontColor         Pixel          foreground          SGI
XtNforeground        Pixel          XtDefaultForeground SGI
XtNheight            Dimension      (calculated)        SGI
XtNgranularity       int            1                   SGI
XtNinputFocusColor   Pixel          Red                 SGI
XtNmappedWhenManaged Boolean        TRUE                SGI
XtNminLabel          String         NULL                SGI
XtNmaxLabel          String         NULL                SGI
XtNmnemonic          unsigned       char                NULL
XtNorientation       OlDefine       OL_VERTICAL         GI
XtNrecomputeSize     Boolean        FALSE               SGI
XtNreferenceName     String         NULL                SGI
XtNreferenceWidget   Widget         NULL                SGI
XtNscale             int            12                  ISG
XtNsensitive         Boolean        TRUE                GI∗
XtNsliderMax         int            100                 SGI
XtNsliderMin         int            0                   SGI
XtNsliderValue       int            0                   SGI
XtNspan              Dimension      OL_IGNORE           SGI
XtNticks             int            0                   SGI
XtNtickUnit          OlDefine       OL_NONE             SGI
XtNtraversalOn       Boolean        TRUE                SGI
XtNuserData          XtPointer      NULL                SGI
XtNwidth             calculated)    SGI
XtNx                 Position       0                   SGI
XtNy                 Position       0                   SGI

XtNfont

 class:XtCFont type:FontStruct∗ default:(OPENLOOK default)access:SGI
 class:XtCFonttype:FontStruct∗default:(OPENLOOK default)access:SGI


 

This resource specifies the font used to draw the labels. It defaults to the OPENLOOK standard font. 

XtNfontcolor

 class:XtCFontColor type:Pixel default:foregroundaccess:SGI

This resource specifies the color used to draw the labels. It defaults

XtCForeground

 class:XtCForeground type:Pixel default:Blackaccess:SGI

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 resources3w. 

XtNminLabel

 class:XtCMinLabel type:String default:NULLaccess:SGI

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

 class:XtCLabel type:String default:NULLaccess:SGI

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 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

 class:XtNorientation type:OlDefine default:OL_VERTICALaccess:GI

Range of Values:

OL_HORIZONTAL/"horizontal"
OL_VERTICAL/"vertical"

This resource defines the direction for the visual presentation of the widget. 

XtNrecomputeSize

 class:XtNrecomputeSize type:Boolean default:FALSEaccess:SGI

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.  to the foreground color of the gauge widget. 

XtNsliderMax

 class:XtNsliderMax type:int default:100access:SGI

XtNsliderMin

 class:XtNsliderMin type:int default:0access:SGI

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

 class:XtCSliderValue type:int default:0access:SGI

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. 

XtNspan

 class:XtCSspan type:Dimension default:OL_IGNOREaccess:SGI

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. 

XtNticks

 class:XtCTticks type:int default:0access:SGI

tick marks. The unit of the interval value is determined by XtNtickUnit. 

XtNtickUnit

 class:XtCTickUnit type:OlDefine default:OL_NONEaccess:SGI

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. 

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. 
 
 
 

Version 3.0  —  19 July 91

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026