The XbaeInput widget is ideal for restricting data input to a digit, alphanumeric character or an alphabetic character. If XmNconvertCase is set, the widget automatically changes an inserted character to uppercase or lowercase. Literal characters can also be included in the XmNpattern that can be automatically inserted as the user types by setting the XmNautofill resource to True. Optional literals cannot be auto inserted, however.
Unlike the XmText field from which this widget is subclassed, the toggle-overwrite action is bound to the osfInsert key. The XmNoverwriteMode is also provided to allow the resource to be changed programatically.
When the XbaeInput widget loses focus or is activated in the same way as the XmText field would be, callbacks on the XmNvalidateCallback list are invoked, allowing the programmer to validate the data as well as reformatting the existing string.
XbaeInput Resource Set | ||||
Name Class Type Default Access | ||||
XmNalignment XmCAlignment unsigned char XmALIGNMENT_BEGINNING CSG | ||||
XmNautoFill XmCBoolean Boolean False CSG | ||||
XmNconvertCase XmCBoolean Boolean True CSG | ||||
XmNoverwriteMode XmCBoolean Boolean False CSG | ||||
XmNpattern XmCString String NULL CSG | ||||
XmNvalidateCallback XmCCallback Callback NULL CSG |
Specifies the alignment of the text when being edited and displayed. Possible values are XmALIGNMENT_BEGINNINGand XmALIGNMENT_END. If XmNalignment is set to XmALIGNMENT_END, the text will be right justified. If left as the default of XmALIGNMENT_BEGINNING, the text will be left justified.
a | alphabetic characters only |
b | both - either digit or character |
c | any character at all |
d | digits only |
U | upperchase character only |
L | lowercase character only |
[ | start of optional sequence |
] | end of optional sequence |
\\ | escapes the next character |
| | next char is an alternative to previous. May be chained. |
XmText Resource Set | ||||
Name Class Type Default Access | ||||
XmNautoShowCursorPosition XmCAutoShowCursorPosition Boolean True CSG | ||||
XmNcursorPosition XmCCursorPosition XmTextPosition 0 CSG | ||||
XmNeditable XmCEditable Boolean True CSG | ||||
XmNeditMode XmCEditMode int XmSINGLE_LINE_EDIT CSG | ||||
XmNfocusCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNgainPrimaryCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNlosePrimaryCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNlosingFocusCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNmarginHeight XmCMarginHeight Dimension 5 CSG | ||||
XmNmarginWidth XmCMarginWidth Dimension 5 CSG | ||||
XmNmaxLength XmCMaxLength int largest integer CSG | ||||
XmNmodifyVerifyCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNmodifyVerifyCallbackWcs XmCCallback XtCallbackList NULL CSG | ||||
XmNmotionVerifyCallback XmCCallback XtCallbackList NULL CSG | ||||
XmNsource XmCSource XmTextSource Default source CSG | ||||
XmNtopCharacter XmCTextPosition XmTextPosition 0 CSG | ||||
XmNvalue XmCValue String "" CSG | ||||
XmNvalueChangedCallback XmCCallback XtCallbackList NULL CSG | ||||
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 | ||||
XmNforeground XmCForeground Pixel dynamic CSG | ||||
XmNhighlightColor XmCHighlightColor Pixel dynamic CSG | ||||
XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG | ||||
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG | ||||
XmNhighlightThickness XmCHighlightThickness Dimension 2 CSG | ||||
XmNnavigationType XmCNavigationType XmNavigationType XmNONE CSG | ||||
XmNshadowThickness XmCShadowThickness Dimension 2 CSG | ||||
XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG | ||||
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG | ||||
XmNtraversalOn XmCTraversalOn Boolean True CSG | ||||
XmNunitType XmCUnitType unsignedChar dynamic CSG | ||||
XmNuserData XmCUserData Pointer NULL CSG |
Core Resource Set | ||||
Name Class Type Default Access | ||||
XmNaccelerators XmCAccelerators XtAccelerators NULL 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 1 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 |
typedef struct | ||
{ | ||
int reason; | ||
XEvent *event; | ||
String pattern; | ||
String value; | ||
Boolean doit; | ||
lb s s. | ||
} XbaeInputValidateCallbackStruct; |
This callback provides the application of checking the validity of the value entered into the XbaeInput widget. Checking the validity of a date may be one such instance. If the value is verified as valid, all values of the callback may be left unchanged. If the pointer to the value is changed, the new value will be displayed in the cell and storage for the old value deallocated by the XbaeInput widget. The new value's memory is owned by the application and it is up to the application to use XtFree to deallocate it.
If the value is not considered valid, the doit flag should be set to False, forcing the user to make changes before the value can be accepted.
:<Key>osfInsert: | toggle-overstrike() |
translation installed by default. If this is the case, XbaeInput automatically registers this translation.
XbaeInput does not define any new type converters other than the standard type converters registered by Xt and Motif.
The following external entry points to XbaeInput class methods are defined:
XbaeCreateInput()
Widget XbaeCreateInput() Widget parent; String name; ArgList arglist; Cardinal argcount;
- parent
- Specifies the parent widget ID.
- name
- Specifies the name of the created widget
- arglist
- Specifies the argument list
- argcount
- Specifies the number of attribute/value pairs in the argument list (arglist)
XbaeCreateInput() creates an instance of an XbaeInput widget and returns the associated widget ID.
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3X) .
This document describes XbaeInput from Xbae Version 4.7.
The Author, previous and current maintainers of the Xbae widgets (collectively 'authors') provide this information solely to professionals who have the appropriate degree of experience to understand and interpret its contents in accordance with generally accepted engineering or other professional standards and applicable regulations. No recommendations as to products or vendors is made or should be implied.
While the information contained herein has been prepared from sources deemed to be reliable, the authors reserve the right to revise the information without notice, but have no obligation to do so. Unless the recipient has been expressly granted a license by Bellcore under separate applicable written agreement with Bellcore, no license, expressed or implied, is granted under any patents, copyrights or other intellectual property rights. Use of the information is at your discretion and shall not be deemed an inducement by Bellcore to infringe any existing or later-issued patent, copyrights or other intellectual property right.
THE AUTHORS MAKE NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EXPRESS OR IMPLIED, WITH RESPECT TO THE INFORMATION, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST INFRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS. THE INFORMATION IS PROVIDED ``AS IS'', AND IN NO EVENT SHALL THE AUTHORS OR ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELATING TO THE INFORMATION.
Copyright 1999 Andrew Lister. All Rights Reserved.
The above no warranty extends to all additions and contributions. No contributor shall be held liable; this work is provided ``as is''. If this is a problem for you, then don't use this software.