XltNumEntry(3X)

NAME
XltNumEntry - The NumEntry widget class

SYNOPSIS
#include <Xlt/NumEntry.h>

DESCRIPTION
NumEntry is used to enter numerical data. It consists of a label, a TextField and, two arrow buttons. The text entered is run through a calculator and the result of the calculation is displayed. The arrow buttons are used to increment/decrement the digit to the right of the insertion cursor. The arrows have an auto-repeat feature.

The user can specify resources in a resource file for the automatically created widgets. The following is a list of the names of these widgets.

Label - "Label"

TextField - "Text"

RowColumn - "RowCol"

ArrowButton - "UpArrow"

ArrowButton - "DnArrow"

  Classes
NumEntry inherits behavior and resources from the Core, Composite, Constraint, XmManager, and XmForm classes.

The class pointer is XltNumEntryWidgetClass.

The class name is XltNumEntry.

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

XltNumEntry Resource Set
Name | Class | Type | Default | Access
XmNlabelString | XtCLabelString | XmString | dynamic | CSG
XmNvalue | XmCValue | String | "" | CSG
XmNcolumns | XmCColumns | short | 20 | CSG
XmNvalueChangedCallback | XtCCallback | XtCallbackList | NULL | C
XmNactivateCallback | XtCCallback | XtCallbackList | NULL | C
XmNlosingFocusCallback | XtCCallback | XtCallbackList | NULL | C
XmNhelpCallback | XtCCallback | XtCallbackList | NULL | C
XltNinitialDelay | XltCInitialDelay | int | 1000 | CSG
XltNdelay | XltCDelay | int | 100 | CSG

XmNlabelString
    The label displayed to the left of the text field. If not specified it will be the name of the widget.

XmNvalue
    This is the same as the value of the TextField widget.

XmNcolumns
    This is the same as the value of the TextField widget.

XmNvalueChangedCallback
    Specifies the list of callbacks that is called when the value changes. The reason sent by the callback is XmCR_VALUE_CHANGED.

XmNactivateCallback
    This is the same as the TextField activateCallback.

XmNlosingFocusCallback
    This is the same as the TextField losingFocusCallback.

XmNhelpCallback
    A help callback is automatically attached that displays a summary of the calculator functions.

XltNinitialDelay
    Time to wait, in ms, until the auto repeat kicks in.

XltNdelay
    The time, in ms, between automatic repeats.

  Inherited Resources
NumEntry inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass.

Core Resource Set
Name | Class | Type | Default | Access
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C
XmNscreen | XmCScreen | Screen * | dynamic | CG

  Callback Information
A pointer to the following structure is passed to the valueChanged callback:
typedef struct
{
	int	reason;
	XEvent	*event;
	Boolean	doit;
	char	*value;
	double	dvalue;
} XltNumEntryVerifyCallbackStruct;

reason
    Indicates why the callback was invoked

event
    This is always NULL.

doit
    This is a flag that indicates wether or not the value will replace the contents of the TextField. If false, the old text will be left in the TextField.

value
    This is the text that will be placed in the TextField widget. If you do not like the way it is formated feel free to XtFree(value) and replace it with anything you like.

dvalue
    This is the result of the the calculation performed on the entered text. You can use this value to format the value string how you want.

All other callbacks are the same as their TextField equivalents.

  Translations
The following translations are defined for XltNumEntry:

<Key>osfDown: Down()
<Key>osfUp:   Up()
!<Btn4Down>: Up()
!<Btn5Down>: Down()

  Action Routines
The XltNumEntry action routines are described below:

Up():
    Increment the digit to the right of the cursor.

Down():
    Decrement the digit to the right of the cursor.

Help():
    Display the calculator help dialog.

  Behavior
XltNumEntry behavior is described below:

    Text is entered and run through a calculator with the result displayed back in the TextField. The arrow buttons can be used to increment/decrement the digit to the right of the insertion cursor. The buttons have an auto-repeat feature invoked by holding the button down. The calculator is called whenever the text field is losing focus, activate is pressed or, a button is used to modify a digit. If the result of the calculation is different than last time the value changed callbacks are called. Pressing F1 while the widget has focus will pop up a dialog with a summary of the calculator features.

  Virtual Bindings
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3X).

RELATED INFORMATION
XltCreateNumEntry(3X), XltVaCreateNumEntry(3X), calc(1) (if you are lucky enough to have it),