Rheostat(3)

NAME
Rheostat - Angular display/input widget

DESCRIPTION

Rheostat is a round, dial-like valuator widget that may be used for input or display of integer values. It comes in both vanilla and Motif flavours. It is a general-purpose valuator, but it's especially useful for displaying and entering angles. Set *minimumValue and *minimumAngle to 0, and *minimumValue and *minimumAngle to 360 to configure a Rheostat as an angle valuator. Compile with -DMOTIF=1 to get the Motif version. The class pointer is xfwfRheostatWidgetClass.

APPEARANCE AND BEHAVIOUR
The Rheostat has the following appearance components, from outside to inside:

Ticks
    Markers placed at even intervals around the dial face. If XtNtickGravity is True, then pressing the mouse in the tick region will ``snap'' the indicator to the nearest tick.

Dial
    A circular arc drawn around the margin.

Indicator
    The arrow-shaped pointer which displays the current widget value. Clicking button 1 anywhere inside the widget will set the indicator to point at the current mouse position.

NEW RESOURCES

    Minimum and maximum displayable values of the widget.

    The current value of the widget. This will always be in the range [minimumValue, maximumValue].

    Angles in degrees of the indicator when XtNvalue is at its minimum and maximum value, respectively. Angles are measured clockwise, with 0 straight down, 90 to the left, 180 straight up, and 270 to the right. Note that this is different from the way Xlib does things.

    Controls the ``tick gravity'' feature: If True, then the indicator will snap to the nearest tick when button 1 is depressed with the pointer in the tick region.

    The number of tick intervals to display.

    If this resource is True, then the Rheostat will resize the indicator proportionally when the widget is resized. If False, then the indicator remains the same size.

    These resources control the size of the widget. XtNouterMargin is the distance from the window border to the outside of the tick region; XtNtickLength is the length of the tick marks; XtNdialThickness is the line width of the dial; XtNinnerMargin is the distance from the inside of the dial to the indicator tip; and XtNradius is the distance from the indicator tip to the center of the widget.

    These resources control the appearance of the indicator. XtNinnerArrowLength is the distance from the indicator tip to the inner arrow point; XtNarrowWidth is the distance between the two outer arrow points; and XtNouterArrowLength is the distance from the tip to the outer arrow points. (There should be a FIG file with the source code which illustrates this more clearly). If XtNfillArrow is True, the indicator will be filled; otherwise, only the outline is drawn with a line width of XtNarrowThickness.

    These resources specify the color of the indicator, dial, and tick marks, respectively.

    (Motif version only). If set, then use the Motif-computed top shadow color for XtNdialColor and the bottom shadow color for XtNarrowColor. This looks pretty good.

ACTIONS AND CALLBACKS

Set()
    Should only be bound to motion or button events; aims the indicator at the pointer location, and invokes all callbacks on the XtNsetCallback list.

Notify()
    Invokes all callbacks on the XtNnotify callback list.

Increment(max|min)
    This is not a very well-defined action. UTSL...

Both the XtNsetCallback and XtNnotify callbacks pass a pointer to the following structure as the call_data parameter:

/*
 * Rheostat callback structure:
 */
typedef struct {
    int  	reason;
    XEvent 	*event;
    int		value;
} XfwfRheostatCallbackStruct;

value holds the current value of the indicator. The event field is set to the X event which triggered the callback. The reason field is not filled in and is only present because Motif likes all callbacks to start off with reason and event fields.

DEFAULT TRANSLATIONS

<Btn1Down>: set()
<Btn1Motion>: set()
<Btn1Up>: notify()
<Key>minus: increment(-1) notify()
<Key>plus: increment(+1) notify()
<Key>Prior: increment(-1i) notify() ; osfPageUp in Motif version
<Key>Next: increment(+1i) notify() ; osfPageDown
<Key>Home: increment(min) notify()
<Key>End: increment(max) notify()
<Key>Return: notify()

AUTHOR

Joe English
joe@trystero.art.com