SYNOPSIS

#include <Xm/DataF.h>

DESCRIPTION

The DataField widget is a Data Presentation widget that handles display and entry of data as text. The DataField widget is a subclass of the XmTextField widget intended for data entry applications. In addition to all of the normal XmTextField functionality, it supports regular expression-based parsing and acceptance/rejection of its input through the XmNpicture resource, and right justification through the XmNalignment resource.

The DataField widget provides added capability by supporting several types of validation: a DataField widget containing an invalid value will not give-up focus; the user must enter a correct value before proceeding to another field.

Classes

DataField inherits behavior, resources, and traits from Core, XmPrimitive, and XmTextField.

The class pointer is xmDataFieldWidgetClass.

The class name is XmDataField.

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

XmDataField Resource Set
Name Class Type Default Access
_ _ _ _ _
XmNalignment XmCAlignment unsigned char XmALIGNMENT_BEGINNING
CSG _ _ _ _
_ XmNautoFill XmCAutoFill Boolean
True CSG _ _ _
_ _ XmNpicture XmCPicture
String NULL CSG _ _
_ _ _ XmNpictureErrorCallback
XmCCallback XtCallbackList NULL C _
_ _ _ _
XmNvalidateCallback XmCCallback XtCallbackList NULL C
_ _ _ _ _
XmNalignment

When set to XmALIGNMENT_END, the widget aligns all its text with the right hand side of the input area.

XmNautoFill

When set to True, the widget "auto-fills" its contents when it can determine that the next character in the string must be a particular literal. For instance, the picture "###-####" automatically inserts a '-' character after receiving three numeric digits as input.

XmNpicture

Specifies a picture for data entry in the widget. A picture acts as a template that formats the value you enter in a field. An example would be the US Phone Number picture: (###)###-####. The picture is used to convert characters entered into the field to a formatted value.

Character interpretations

The following lists and defines the characters you can use in a picture, and how the DataField widget interprets them.

#

Any numeric digit

?

Case insensitive letter

&

Uppercase letter (forces lowercase to uppercase)

@

Case insensitive character

!

Uppercase character

;

Interpret the following character literally

*

Repeat the following character some number of times

[]

Characters within brackets are optional

{}

Characters within braces are grouped

,

Alternative values

Other characters are interpreted literally.

Set XmNpicture to NULL to disable regular expression processing. The DataField widget is cleared whenever the XmNpicture resource is changed.

XmNpictureErrorCallback

Specifies a list of callbacks to be called when the XmDataField widget determines that data is being entered that does not match the format specified by the XmNpicture resource.

XmNvalidateCallback

Specifies a list of callbacks to be called when data has been entered in the XmDataField widget and the user has moved out of the XmDataField widget (usually by pressing the Tab key). The callbacks can reject the movement of focus.

Inherited Resources

DataField inherits behavior and resources from the superclasses described in the following tables. For a complete description of each resource, refer to the reference page for that superclass.

XmTextFieldResource Set
Name Class Type Default Access
_ _ _ _ _
XmNactivateCallback XmCCallback XtCallbackList NULL
C _ _ _ _
_ XmNblinkRate XmCBlinkRate int
500 CSG _ _ _
_ _ XmNcolumns XmCColumns
short dynamic CSG _ _
_ _ _ XmNcursorPosition
XmCCursorPosition XmTextPosition 0 CSG _
_ _ _ _
XmNcursorPositionVisible XmCCursorPositionVisible Boolean dynamic CSG
_ _ _ _ _
XmNdestinationCallback XmCCallback XtCallbackList NULL
C _ _ _ _
_ XmNeditable XmCEditable Boolean
True CSG _ _ _
_ _ XmNfocusCallback XmCCallback
XtCallbackList NULL C _ _
_ _ _ XmNfontList
XmCFontList XmFontList dynamic CSG _
_ _ _ _
XmNgainPrimaryCallback XmCCallback XtCallbackList NULL C
_ _ _ _ _
XmNlosePrimaryCallback XmCCallback XtCallbackList NULL
C _ _ _ _
_ XmNlosingFocusCallback XmCCallback XtCallbackList
NULL C _ _ _
_ _ XmNmarginHeight XmCMarginHeight
Dimension 5 CSG _ _
_ _ _ XmNmarginWidth
XmCMarginWidth Dimension 5 CSG _
_ _ _ _
XmNmaxLength XmCMaxLength int largest integer CSG
_ _ _ _ _
XmNmodifyVerifyCallback XmCCallback XtCallbackList NULL
C _ _ _ _
_ XmNmodifyVerifyCallbackWcs XmCCallback XtCallbackList
NULL C _ _ _
_ _ XmNmotionVerifyCallback XmCCallback
XtCallbackList NULL C _ _
_ _ _ XmNpendingDelete
XmCPendingDelete Boolean True CSG _
_ _ _ _
XmNrenderTable XmCRenderTable XmRenderTable dynamic CSG
_ _ _ _ _
XmNresizeWidth XmCResizeWidth Boolean False
CSG _ _ _ _
_ XmNselectionArray XmCSelectionArray XtPointer
default array CSG _ _ _
_ _ XmNselectionArrayCount XmCSelectionArrayCount
int 3 CSG _ _
_ _ _ XmNselectThreshold
XmCSelectThreshold int 5 CSG _
_ _ _ _
XmNvalue XmCValue String "" CSG
_ _ _ _ _
XmNvalueChangedCallback XmCCallback XtCallbackList NULL
C _ _ _ _
_ XmNvalueWcs XmCValueWcs wchar_t *
(wchar_t *)"" CSG _ _ _
_ _ XmNverifyBell XmCVerifyBell
Boolean dynamic CSG _ _
_ _ _
XmPrimitive Resource Set
Name Class Type Default Access
_ _ _ _ _
XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic
CSG _ _ _ _
_ XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap
XmUNSPECIFIED_PIXMAP CSG _ _ _
_ _ XmNconvertCallback XmCCallback
XtCallbackList NULL C _ _
_ _ _ XmNforeground
XmCForeground Pixel dynamic CSG _
_ _ _ _
XmNhelpCallback XmCCallback XtCallbackList NULL C
_ _ _ _ _
XmNhighlightColor XmCHighlightColor Pixel dynamic
CSG _ _ _ _
_ XmNhighlightOnEnter XmCHighlightOnEnter Boolean
False CSG _ _ _
_ _ XmNhighlightPixmap XmCHighlightPixmap
Pixmap dynamic CSG _ _
_ _ _ XmNhighlightThickness
XmCHighlightThickness Dimension 2 CSG _
_ _ _ _
XmNlayoutDirection XmCLayoutDirection XmDirection dynamic CG
_ _ _ _ _
XmNnavigationType XmCNavigationType XmNavigationType XmTAB_GROUP
CSG _ _ _ _
_ XmNpopupHandlerCallback XmCCallback XtCallbackList
NULL C _ _ _
_ _ XmNshadowThickness XmCShadowThickness
Dimension 2 CSG _ _
_ _ _ XmNtopShadowColor
XmCTopShadowColor Pixel dynamic CSG _
_ _ _ _
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG
_ _ _ _ _
XmNtraversalOn XmCTraversalOn Boolean True
CSG _ _ _ _
_ XmNunitType XmCUnitType unsigned char
dynamic CSG _ _ _
_ _ XmNuserData XmCUserData
XtPointer NULL CSG _ _
_ _ _
Core Resource Set
Name Class Type Default Access
_ _ _ _ _
XmNaccelerators XmCAccelerators XtAccelerators dynamic
CSG _ _ _ _
_ XmNancestorSensitive XmCSensitive Boolean
dynamic G _ _ _
_ _ XmNbackground XmCBackground
Pixel dynamic CSG _ _
_ _ _ XmNbackgroundPixmap
XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG _
_ _ _ _
XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
_ _ _ _ _
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP
CSG _ _ _ _
_ XmNborderWidth XmCBorderWidth Dimension
0 CSG _ _ _
_ _ XmNcolormap XmCColormap
Colormap dynamic CG _ _
_ _ _ XmNdepth
XmCDepth int dynamic CG _
_ _ _ _
XmNdestroyCallback XmCCallback XtCallbackList NULL C
_ _ _ _ _
XmNheight XmCHeight Dimension dynamic
CSG _ _ _ _
_ XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean
True C _ _ _
_ _ XmNmappedWhenManaged XmCMappedWhenManaged
Boolean True CSG _ _
_ _ _ XmNscreen
XmCScreen Screen * dynamic CG _
_ _ _ _
XmNsensitive XmCSensitive Boolean True CSG
_ _ _ _ _
XmNtranslations XmCTranslations XtTranslations dynamic
CSG _ _ _ _
_ XmNwidth XmCWidth Dimension
dynamic CSG _ _ _
_ _ XmNx XmCPosition
Position 0 CSG _ _
_ _ _ XmNy
XmCPosition Position 0 CSG _
_ _ _ _

Translations

XmDataField inherits translations from XmTextField.

Callback Routines

A pointer to the following structure is passed to the list of routines for the XmNvalidateCallback:

typedef struct _XmDataFieldCallbackStruct {
	Widget   w;       /* The XmDataField */
	String   text;    /* Proposed string */
	Boolean  accept;  /* Accept return value, for validation */
} XmDataFieldCallbackStruct;

RELATED

VERSION

This manual page documents the XmDataField widget shipped in Motif version 2.2

AUTHOR

(c) 2002 by Integrated Computer Solutions, Inc.

Edited by Kevin Cook.