XbaeInput(3)
๐ XbaeInput(3) ๐
okay so this is the manual page for XbaeInput, and it lives in the Library Functions Manual, bestie. it's long, it's iconic, and we're doing it in parts, so buckle up ๐
๐ NAME ๐
XbaeInput โ the Input widget class. that's it. short, sweet, main character energy ๐
๐ธ SYNOPSIS ๐ธ
#include <Xbae/Input.h>
โจ DESCRIPTION โจ
okay so XbaeInput is a text input field that does generic customised data entry and formatting for strings. the way it pulls this off?? a clever XmNmodifyVerifyCallback that gets installed the moment you set the XmNpattern resource. and the XmNpattern value can include optional characters and literals โ we'll get into all of that later in this doc, don't worry ๐ซถ
XbaeInput is literally ideal for restricting data input to a digit, an alphanumeric character, or an alphabetic character. and if you set XmNconvertCase, the widget just automatically flips an inserted character to uppercase or lowercase for you. no cap โจ
literal characters can also be baked into the XmNpattern and auto-inserted as the user types โ that happens when you set the XmNautofill resource to True. but (and this is important, bestie) optional literals cannot be auto inserted. okay?? noted ๐
so here's a difference from XmText, which this widget is subclassed from: the toggle-overwrite action is bound to the osfInsert key. and XmNoverwriteMode is also there so you can change that resource programmatically. slay ๐
when the XbaeInput widget loses focus, or gets activated the same way an XmText field would be, the callbacks on the XmNvalidateCallback list get invoked. that's your moment to validate the data and reformat the existing string. programmer's choice, honestly ๐
๐ฆ Classes ๐ฆ
XbaeInput inherits behavior and resources from the Core, XmPrimitive, and XmText widget classes.
- the class pointer is
xbaeInputWidgetClass - the class name is
XbaeInput
๐ New Resources ๐
here's the tea: the following table lists the new resources defined by XbaeInput. the codes in the Access column tell you whether the given resource can be set at creation time (C), or set using XtSetValues (S), or retrieved using XtGetValues (G). iykyk ๐
XbaeInput Resource Set:
XmNalignmentโ classXmCAlignment, typeunsigned char, defaultXmALIGNMENT_BEGINNING, accessCSGXmNautoFillโ classXmCBoolean, typeBoolean, defaultFalse, accessCSGXmNconvertCaseโ classXmCBoolean, typeBoolean, defaultTrue, accessCSGXmNoverwriteModeโ classXmCBoolean, typeBoolean, defaultFalse, accessCSGXmNpatternโ classXmCString, typeString, defaultNULL, accessCSGXmNvalidateCallbackโ classXmCCallback, typeCallback, defaultNULL, accessCSG
This resource has not been implemented.
๐ XmNalignment
This resource has not been implemented!
specifies the alignment of the text when it's being edited and displayed. possible values are XmALIGNMENT_BEGINNING and XmALIGNMENT_END. if XmNalignment is set to XmALIGNMENT_END, the text is right justified. if you just leave it at the default XmALIGNMENT_BEGINNING, the text is left justified. cute, right? ๐
๐ XmNautoFill
the XmNautoFill resource, when set to True, tries to automatically insert a literal if a non-literal is hit in an allowed literal position. for example!! if the XmNpattern resource was set up to accept a date in dd/mm/yyyy format and the user typed "18041999", the resulting string would appear as "18/04/1999". iconic โจ
the default value is False, where the user would have to type the literal themselves. no autofill, no shortcut, you do the work bestie ๐ญ
๐ XmNconvertCase
this one tells the XbaeInput widget what should be done to alphabetic characters if the [pattern] requires a lowercase or uppercase letter.
- if
XmNconvertCaseis set toTrue(the default), the character is automatically converted to the correct case ๐ซ - if set to
False, then the user must type the character in the correct case for it to be accepted. strict much?? ๐
see the EXAMPLE PATTERNS section towards the end of this document for some examples ๐
๐ overwriteMode
whether the widget accepts characters in insert mode or overwrite mode is controlled by the resource. setting this resource calls the XmText toggle-overwrite() action routine, so heads up: the Motif toolkit being used must also support this routine. don't come for me, that's just the rules ๐
๐ XmNpattern
the XmNpattern resource specifies what can be typed into the XbaeInput widget. if you set it to the default value of NULL, any character may be entered โ free for all, do whatever ๐
XmNpattern can be set to a string containing the following characters:
aโ alphabetic characters onlybโ both, either digit or charactercโ any character at alldโ digits onlyUโ upperchase character onlyLโ 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.
๐ง Inherited Resources ๐ง
the following table lists the resources which XbaeInput inherits from it's superclasses XmText, XmPrimitive, and Core. for a complete description of each resource, go read the man page for that superclass, bestie โ they've got the full lore ๐
the codes in the "Access" column tell you whether the given resource can be set at creation time (C), or set using XtSetValues (S), or retrieved using XtGetValues (G). same deal as before ๐
๐ธ XmText Resource Set ๐ธ
okay bestie, buckle up, because this is the whole entire resource table for XmText and it is long. ๐ Every single row has five little things you need to know about it: the Name, the Class, the Type, the Default, and the Access. No cap, that's the whole structure.
And the access column? Every. Single. One. is CSG. All twenty of them. Iconic consistency honestly. ๐
XmNautoShowCursorPositionโ classXmCAutoShowCursorPosition, typeBoolean, defaultTrue, accessCSGXmNcursorPositionโ classXmCCursorPosition, typeXmTextPosition, default0, accessCSGXmNeditableโ classXmCEditable, typeBoolean, defaultTrue, accessCSGXmNeditModeโ classXmCEditMode, typeint, defaultXmSINGLE_LINE_EDIT, accessCSGXmNfocusCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNgainPrimaryCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNlosePrimaryCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNlosingFocusCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNmarginHeightโ classXmCMarginHeight, typeDimension, default5, accessCSGXmNmarginWidthโ classXmCMarginWidth, typeDimension, default5, accessCSGXmNmaxLengthโ classXmCMaxLength, typeint, default largest integer, accessCSGXmNmodifyVerifyCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNmodifyVerifyCallbackWcsโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNmotionVerifyCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNsourceโ classXmCSource, typeXmTextSource, default Default source, accessCSGXmNtopCharacterโ classXmCTextPosition, typeXmTextPosition, default0, accessCSGXmNvalueโ classXmCValue, typeString, default"", accessCSGXmNvalueChangedCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNvalueWcsโ classXmCvalueWcs, typewchar_t *, default(wchar_t *)"", accessCSGXmNverifyBellโ classXmCVerifyBell, typeBoolean, defaultdynamic, accessCSG
twenty resources, zero skips, we ate that whole table fr fr ๐ โจ and bestie we are not done yet, keep scrolling ๐ฆ
๐ซถ XmPrimitive Resource Set ๐ซถ
okay so real talk bestie โ before we even touch the stuff that makes XbaeInput special, it inherits a whole closet full of resources from XmPrimitive first ๐
and every single one of them is laid out in the original with five little columns: Name, Class, Type, Default, and Access. I'm giving you all of them below, one per bullet, zero skipped, no cap. ๐ฅ
And yes, the Access column is CSG for literally every single one of these โ that's just the whole table, bestie, every row, uniform. โจ
XmNbottomShadowColorโ classXmCBottomShadowColor, typePixel, default dynamic, accessCSG. The color of the bottom shadow, the little drama shading underneath. ๐XmNbottomShadowPixmapโ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG. A pixmap for that same bottom shadow if you're feeling textured instead of flat. ๐ฆXmNforegroundโ classXmCForeground, typePixel, default dynamic, accessCSG. The main character of colors here โ the foreground. ๐XmNhighlightColorโ classXmCHighlightColor, typePixel, default dynamic, accessCSG. The color used for highlighting. so sparkly, so seen. โญXmNhighlightOnEnterโ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSG. Whether highlighting turns on when the pointer enters. Default isFalse, so out of the box it's giving chill, not giving glow. ๐XmNhighlightPixmapโ classXmCHighlightPixmap, typePixmap, default dynamic, accessCSG. The pixmap version of that highlight situation. ๐XmNhighlightThicknessโ classXmCHighlightThickness, typeDimension, default2, accessCSG. How thick the highlight is. Default2. slay, a modest little frame. ๐XmNnavigationTypeโ classXmCNavigationType, typeXmNavigationType, defaultXmNONE, accessCSG. Controls the navigation type, and it starts atXmNONE. periodt. ๐XmNshadowThicknessโ classXmCShadowThickness, typeDimension, default2, accessCSG. How thick the shadow is. Also default2. twins with the highlight thickness fr fr. ๐ญXmNtopShadowColorโ classXmCTopShadowColor, typePixel, default dynamic, accessCSG. The top shadow color โ the light coming from above, the glow-up. ๐ธXmNtopShadowPixmapโ classXmCTopShadowPixmap, typePixmap, default dynamic, accessCSG. Same energy but as a pixmap for the top shadow. โจXmNtraversalOnโ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSG. Whether traversal is on. Defaults toTrue, so yes bestie, it's on. ๐XmNunitTypeโ classXmCUnitType, typeunsignedChar, default dynamic, accessCSG. The unit type, stored as anunsignedChar. the way that's such a specific type ๐ญ iconic. ๐งXmNuserDataโ classXmCUserData, typePointer, defaultNULL, accessCSG. Your own lil pocket for arbitrary user data. It starts asNULL, so it's all yours to fill. ๐
no cap, that's the entireXmPrimitiveset โ every Name, every Class, every Type, every Default and everyCSGaccounted for. nothing got cut, nothing got "cleaned up". ๐
๐ Core Resource Set ๐
ok so this is the whole core resource table bestie, every single one, no skips ๐ โ name, class, type, default, access, the works. Access codes are exactly what they say they are, i'm not gonna invent lore for them, that's the rules.
XmNacceleratorsโ classXmCAccelerators, typeXtAccelerators, defaultNULL, accessCSGโจXmNancestorSensitiveโ classXmCSensitive, typeBoolean, defaultdynamic, accessG๐ฆXmNbackgroundโ classXmCBackground, typePixel, defaultdynamic, accessCSG๐XmNbackgroundPixmapโ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG๐ธXmNborderColorโ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSG๐XmNborderPixmapโ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGโจXmNborderWidthโ classXmCBorderWidth, typeDimension, default1, accessCSG๐ซถXmNcolormapโ classXmCColormap, typeColormap, defaultdynamic, accessCG๐XmNdepthโ classXmCDepth, typeint, defaultdynamic, accessCG๐XmNdestroyCallbackโ classXmCCallback, typeXtCallbackList, defaultNULL, accessC๐XmNheightโ classXmCHeight, typeDimension, defaultdynamic, accessCSG๐XmNinitialResourcesPersistentโ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessC๐ฅXmNmappedWhenManagedโ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSG๐XmNscreenโ classXmCScreen, typeScreen, defaultdynamic, accessCG๐ธXmNsensitiveโ classXmCSensitive, typeBoolean, defaultTrue, accessCSGโจXmNtranslationsโ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSG๐ฆXmNwidthโ classXmCWidth, typeDimension, defaultdynamic, accessCSG๐XmNxโ classXmCPosition, typePosition, default0, accessCSG๐XmNyโ classXmCPosition, typePosition, default0, accessCSG๐
๐ Callback Information ๐
XmNvalidateCallback โ the vibe checker for your input ๐ต๏ธโ๏ธ
Callbacks hanging out on the XmNvalidateCallback list get called when the edits to the XbaeInput widget are activated, or when a losing focus event happens. Every callback function gets handed this struct, exactly this one:
typedef struct
{
int reason;
XEvent *event;
String pattern;
String value;
Boolean doit;
} XbaeInputValidateCallbackStruct;
ok now let's break down the fields one by one, no skipping:
reasonโ set toXmCR_ACTIVATEif the user caused the callback to be invoked by activating the changes in the cell, orXmCR_LOSING_FOCUSif the callback got called because of a losing focus event ๐eventโ the event pointer that triggered the callback, the whole reason we're here fr frpatternโ a pointer to the pattern for theXbaeInputwidget, orNULLif one doesn't exist. This value is provided as a convenience to the callback. (the manpage said it, not me)valueโ the value as it appears in the cell at the time of the callback being invoked ๐doitโ indicates whether or not the value is valid. SetdoittoFalseand the value will not be accepted ๐ซ
This callback is literally here so your application can check the validity of the value entered into the XbaeInput widget. Checking the validity of a date may be one such instance. iconic use case honestly.
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 gets deallocated by the XbaeInput widget. Heads up though: the new value's memory is owned by the application, and it is up to the application to use XtFree to deallocate it. Not your widget's problem, bestie, that's on you ๐ซต
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. sorry babe, fix your input ๐
๐ธ Translations ๐ธ
XbaeInput inherits translations from XmText. Cute, right? But plot twist: some versions of Motif do not have the
:<Key>osfInsert: toggle-overstrike()
translation installed by default. If that's the case, XbaeInput automatically registers this translation. so like, it handles it for you. slay โจ
๐ฆ Type Converters ๐ฆ
XbaeInput does not define any new type converters other than the standard type converters registered by Xt and Motif. That's it. That's the whole section. no extra converters, no secret ones, nothing hiding in the bushes ๐
โจ Public Functions โจ
okay bestie, here are the external entry points to the XbaeInput class methods. they're defined like this:
Widget XbaeCreateInput()
Widget parent;
String name;
ArgList arglist;
Cardinal argcount;
parentโ Specifies the parent widget ID.nameโ Specifies the name of the created widgetarglistโ Specifies the argument listargcountโ 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. slay. ๐
๐ธ EXAMPLE PATTERNS ๐ธ
these are the little pattern moods, bestie:
d[d]/d[d]/dd[dd]โ a date that would accept1/1/99,12/1/99,1/12/1999,01/01/2000, etc.U[L][L][L][L][L], U[L][L][L][L][L]โ "Surname, Firstname" combination, automatically forcing correct case and allowing between 1 and 6 characters per name.UU-dd[d][d]โ a flight number consisting of two uppercase letters and 2 to 4 numbers(ddd) ddd-ddddโ an American style phone numberUdU[-]dUdโ a Canadian postcode with optional dash.
๐ฎ Virtual Bindings ๐ฎ
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3X). iykyk ๐ฆ
๐ AUTHOR ๐
Andrew Lister (lister@db.com)
๐ RELEASE ๐
This document describes XbaeInput from Xbae Version 4.9.
๐ SEE ALSO ๐
Core(3X), XmPrimitive(3X), XmText(3X)
๐ Notice of Limitation ๐
okay so, legal time, but make it cute. 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. periodt.
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. no cap.
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.
Copyright 1999-2002 LessTif Developers
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. ๐
this page is from Xbae version 4.60.4, filed under XbaeInput(3) ๐โจ
๐ฆ where this page comes from
- debian bookworm: libxbae-dev 4.60.4-9
- debian trixie: libxbae-dev 4.60.4-11
- ubuntu jammy: libxbae-dev 4.60.4-9
- ubuntu noble: libxbae-dev 4.60.4-9build2
- ubuntu questing: libxbae-dev 4.60.4-11
- ubuntu resolute: libxbae-dev 4.60.4-11build1
- ubuntu stonking: libxbae-dev 4.60.4-11build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms