File: XmCommand.3

package info (click to toggle)
motif 2.3.8-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,432 kB
  • sloc: ansic: 452,643; sh: 4,611; makefile: 2,030; yacc: 1,604; lex: 352; cpp: 348
file content (522 lines) | stat: -rw-r--r-- 16,952 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
'\" t
...\" Command.sgm /main/12 1996/09/26 14:53:59 cdedoc $
.de P!
.fl
\!!1 setgray
.fl
\\&.\"
.fl
\!!0 setgray
.fl			\" force out current output buffer
\!!save /psv exch def currentpoint translate 0 0 moveto
\!!/showpage{}def
.fl			\" prolog
.sy sed -e 's/^/!/' \\$1\" bring in postscript file
\!!psv restore
.
.de pF
.ie     \\*(f1 .ds f1 \\n(.f
.el .ie \\*(f2 .ds f2 \\n(.f
.el .ie \\*(f3 .ds f3 \\n(.f
.el .ie \\*(f4 .ds f4 \\n(.f
.el .tm ? font overflow
.ft \\$1
..
.de fP
.ie     !\\*(f4 \{\
.	ft \\*(f4
.	ds f4\"
'	br \}
.el .ie !\\*(f3 \{\
.	ft \\*(f3
.	ds f3\"
'	br \}
.el .ie !\\*(f2 \{\
.	ft \\*(f2
.	ds f2\"
'	br \}
.el .ie !\\*(f1 \{\
.	ft \\*(f1
.	ds f1\"
'	br \}
.el .tm ? font underflow
..
.ds f1\"
.ds f2\"
.ds f3\"
.ds f4\"
.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 
.TH "XmCommand" "library call"
.SH "NAME"
\fBXmCommand\fP \(em The Command widget class
.iX "XmCommand"
.iX "widget class" "Command"
.SH "SYNOPSIS"
.PP
.nf
#include <Xm/Command\&.h>
.fi
.SH "DESCRIPTION"
.PP
Command is a special-purpose composite widget for command
entry that provides a built-in command-history mechanism\&.
Command includes a command-line text-input field, a command-line prompt,
and a command-history list region\&.
.PP
One additional \fBWorkArea\fP child may be added to the Command after
creation\&.
.PP
Whenever a command is entered, it is
automatically added to the end of the command-history list and made visible\&.
This does not change the selected item in the list, if there is one\&.
.PP
Many of the new resources specified for Command are actually SelectionBox
resources that have been renamed for clarity and ease of use\&.
.SS "Descendants"
.PP
Command automatically creates the descendants shown in the
following table\&.
An application can use \fBXtNameToWidget\fP to gain access
to the named descendant\&. In addition, a user or an application
can use the named descendant when specifying resource values\&.
.TS
tab() box;
l| l| l.
\fBNamed Descendant\fP\fBClass\fP\fBIdentity\fP
___
=
___
\fBItemsList\fP\fBXmList\fPcommand-history list region
___
\fBItemsListSW\fP\fBXmScrolledWindow\fPT{
the ScrolledWindow parent of \fBItemsList\fP
T}
___
\fBSelection\fP\fBXmLabelGadget\fPcommand-line prompt
___
\fBText\fP\fBXmTextField\fPcommand-line text-input field
___
.TE
.SS "Classes"
.PP
Command inherits behavior, resources, and traits from \fBCore\fP,
\fBComposite\fP, \fBConstraint\fP, \fBXmManager\fP,
\fBXmBulletinBoard\fP, and \fBXmSelectionBox\fP\&.
.PP
The class pointer is \fBxmCommandWidgetClass\fP\&.
.PP
The class name is \fBXmCommand\fP\&.
.SS "New Resources"
.PP
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 \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or
\fBXmC\fP prefix and use the remaining letters\&.
To specify one of the defined
values for a resource in a \fB\&.Xdefaults\fP file,
remove the \fBXm\fP 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 \fBXtSetValues\fP (S),
retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&.
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmCommand Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNcommandXmCTextStringXmString""CSG
_____
XmNcommandChangedCallbackXmCCallbackXtCallbackListNULLC
_____
XmNcommandEnteredCallbackXmCCallbackXtCallbackListNULLC
_____
XmNhistoryItemsXmCItemsXmStringTableNULLCSG
_____
XmNhistoryItemCountXmCItemCountint0CSG
_____
XmNhistoryMaxItemsXmCMaxItemsint100CSG
_____
XmNhistoryVisibleItemCountXmCVisibleItemCountintdynamicCSG
_____
XmNpromptStringXmCPromptStringXmStringdynamicCSG
_____
.TE
.IP "\fBXmNcommand\fP" 10
Contains the current command-line text\&. This is the \fBXmNtextString\fP
resource in SelectionBox, renamed for Command\&.
This resource can also be modified with
\fBXmCommandSetValue\fP and \fBXmCommandAppendValue\fP functions\&.
The command area is a Text widget\&.
.IP "\fBXmNcommandChangedCallback\fP" 10
Specifies the list of callbacks that is called after
each time the value of the command changes\&.
The callback reason is \fBXmCR_COMMAND_CHANGED\fP\&.
This is equivalent to the \fBXmNvalueChangedCallback\fP of the Text
widget, except that a pointer to an \fBXmCommandCallbackStructure\fP is
passed, and the structure\&'s \fIvalue\fP member contains the
\fBXmString\fR\&.
.IP "\fBXmNcommandEnteredCallback\fP" 10
Specifies the list of callbacks that is called
when a command is entered in the Command\&.
The callback reason is \fBXmCR_COMMAND_ENTERED\fP\&. A pointer to an
\fBXmCommandCallback\fP structure is passed\&.
.IP "\fBXmNhistoryItems\fP" 10
Lists \fBXmString\fR items that make up the contents
of the history list\&. This is the \fBXmNlistItems\fP resource in
SelectionBox, renamed for Command\&.
\fBXtGetValues\fP for this resource returns the list items themselves,
not a copy of the list items\&.
The application must not free the returned items\&.
.IP "\fBXmNhistoryItemCount\fP" 10
Specifies the number of \fBXmStrings\fP in \fBXmNhistoryItems\fP\&. This is
the \fBXmNlistItemCount\fP resource in SelectionBox, renamed for Command\&.
The value must not be negative\&.
.IP "\fBXmNhistoryMaxItems\fP" 10
Specifies the maximum number of items allowed in the history list\&. Once
this number is reached, an existing list item must be removed before
a new item can be added to the list\&. For each command entered, the first list
item is removed from the list, so the new command can be added to the list\&.
The value must be greater than 0 (zero)\&.
.IP "\fBXmNhistoryVisibleItemCount\fP" 10
Specifies the number of items in the history list that should be visible at
one time\&. In effect, it sets the height (in lines) of the history list
window\&. This is the \fBXmNlistVisibleItemCount\fP resource in SelectionBox,
renamed for Command\&.
The value must be greater than 0 (zero)\&.
The default is dynamic based on the height of the list\&.
.IP "\fBXmNpromptString\fP" 10
Specifies a prompt for the command line\&.
This is the \fBXmNselectionLabelString\fP
resource in SelectionBox, renamed for Command\&.
The default may vary depending on the value of the
\fBXmNlayoutDirection\fP
resource and the locale\&.
In the C locale the default is > (right angle bracket)\&.
.IP "" 10
Now that some default localized label strings are provided through
message catalogs for the children of composite widgets, the
\fBlabelString\fP resources
cannot be set on the child through default resource files\&.
Instead, the resource provided at the parent level must be used\&.
.SS "Inherited Resources"
.PP
Command 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\&.
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmSelectionBox Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNapplyCallbackXmCCallbackXtCallbackListNULLN/A
_____
XmNapplyLabelStringXmCApplyLabelStringXmStringdynamicN/A
_____
XmNcancelCallbackXmCCallbackXtCallbackListNULLN/A
_____
XmNcancelLabelStringXmCCancelLabelStringXmStringdynamicN/A
_____
XmNchildPlacementXmCChildPlacementunsigned charXmPLACE_ABOVE_SELECTIONCSG
_____
XmNdialogTypeXmCDialogTypeunsigned charXmDIALOG_COMMANDG
_____
XmNhelpLabelStringXmCHelpLabelStringXmStringdynamicN/A
_____
XmNlistItemCountXmCItemCountint0CSG
_____
XmNlistItemsXmCItemsXmStringTableNULLCSG
_____
XmNlistLabelStringXmCListLabelStringXmStringNULLN/A
_____
XmNlistVisibleItemCountXmCVisibleItemCountintdynamicCSG
_____
XmNminimizeButtonsXmCMinimizeButtonsBooleanFalseN/A
_____
XmNmustMatchXmCMustMatchBooleanFalseN/A
_____
XmNnoMatchCallbackXmCCallbackXtCallbackListNULLN/A
_____
XmNokCallbackXmCCallbackXtCallbackListNULLN/A
_____
XmNokLabelStringXmCOkLabelStringXmStringdynamicN/A
_____
XmNselectionLabelStringXmCSelectionLabelStringXmStringdynamicCSG
_____
XmNtextAcceleratorsXmCTextAcceleratorsXtAcceleratorsdefaultC
_____
XmNtextColumnsXmCColumnsshortdynamicCSG
_____
XmNtextStringXmCTextStringXmString""CSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmBulletinBoard Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNallowOverlapXmCAllowOverlapBooleanTrueCSG
_____
XmNautoUnmanageXmCAutoUnmanageBooleanFalseN/A
_____
XmNbuttonFontListXmCButtonFontListXmFontListdynamicN/A
_____
XmNbuttonRenderTableXmCButtonRenderTableXmRenderTabledynamicCSG
_____
XmNcancelButtonXmCWidgetWidgetNULLN/A
_____
XmNdefaultButtonXmCWidgetWidgetNULLN/A
_____
XmNdefaultPositionXmCDefaultPositionBooleanFalseCSG
_____
XmNdialogStyleXmCDialogStyleunsigned chardynamicCSG
_____
XmNdialogTitleXmCDialogTitleXmStringNULLCSG
_____
XmNfocusCallbackXmCCallbackXtCallbackListNULLC
_____
XmNlabelFontListXmCLabelFontListXmFontListdynamicCSG
_____
XmNlabelRenderTableXmCLabelRenderTableXmRenderTabledynamicCSG
_____
XmNmapCallbackXmCCallbackXtCallbackListNULLC
_____
XmNmarginHeightXmCMarginHeightDimension10CSG
_____
XmNmarginWidthXmCMarginWidthDimension10CSG
_____
XmNnoResizeXmCNoResizeBooleanFalseCSG
_____
XmNresizePolicyXmCResizePolicyunsigned charXmRESIZE_NONECSG
_____
XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_OUTCSG
_____
XmNtextFontListXmCTextFontListXmFontListdynamicCSG
_____
XmNtextRenderTableXmCTextRenderTableXmRenderTabledynamicCSG
_____
XmNtextTranslationsXmCTranslationsXtTranslationsNULLC
_____
XmNunmapCallbackXmCCallbackXtCallbackListNULLC
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBXmManager Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG
_____
XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNforegroundXmCForegroundPixeldynamicCSG
_____
XmNhelpCallbackXmCCallbackXtCallbackListNULLC
_____
XmNhighlightColorXmCHighlightColorPixeldynamicCSG
_____
XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG
_____
XmNinitialFocusXmCInitialFocusWidgetdynamicCSG
_____
XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG
_____
XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG
_____
XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC
_____
XmNshadowThicknessXmCShadowThicknessDimensiondynamicCSG
_____
XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG
_____
XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG
_____
XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG
_____
XmNtraversalOnXmCTraversalOnBooleanTrueCSG
_____
XmNunitTypeXmCUnitTypeunsigned chardynamicCSG
_____
XmNuserDataXmCUserDataXtPointerNULLCSG
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBComposite Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNchildrenXmCReadOnlyWidgetListNULLG
_____
XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG
_____
XmNnumChildrenXmCReadOnlyCardinal0G
_____
.TE
.PP
.TS
tab() box;
c s s s s
l| l| l| l| l.
\fBCore Resource Set\fP
\fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP
_____
XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicN/A
_____
XmNancestorSensitiveXmCSensitiveBooleandynamicG
_____
XmNbackgroundXmCBackgroundPixeldynamicCSG
_____
XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG
_____
XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
_____
XmNborderWidthXmCBorderWidthDimension0CSG
_____
XmNcolormapXmCColormapColormapdynamicCG
_____
XmNdepthXmCDepthintdynamicCG
_____
XmNdestroyCallbackXmCCallbackXtCallbackListNULLC
_____
XmNheightXmCHeightDimensiondynamicCSG
_____
XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC
_____
XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG
_____
XmNscreenXmCScreenScreen *dynamicCG
_____
XmNsensitiveXmCSensitiveBooleanTrueCSG
_____
XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG
_____
XmNwidthXmCWidthDimensiondynamicCSG
_____
XmNxXmCPositionPosition0CSG
_____
XmNyXmCPositionPosition0CSG
_____
.TE
.SS "Callback Information"
.PP
A pointer to the following structure is passed to each callback:
.PP
.nf
typedef struct
{
        int \fIreason\fP;
        XEvent \fI* event\fP;
        XmString \fIvalue\fP;
        int \fIlength\fP;
} XmCommandCallbackStruct;
.fi
.IP "\fIreason\fP" 10
Indicates why the callback was invoked
.IP "\fIevent\fP" 10
Points to the \fBXEvent\fP that triggered the callback
.IP "\fIvalue\fP" 10
Specifies the \fBXmString\fR in the CommandArea
.IP "\fIlength\fP" 10
Specifies the size in bytes of the \fBXmString\fR value\&.
This member is obsolete and exists for compatibility with
earlier releases\&.
.SS "Translations"
.PP
\fBXmCommand\fP inherits translations from \fBXmSelectionBox\fP\&.
.SS "Accelerators"
.PP
The \fBXmNtextAccelerators\fP from \fBXmSelectionBox\fP are added to the Text
descendant of \fBXmCommand\fP\&.
.SS "Action Routines"
.PP
The \fBXmCommand\fP action routines are:
.IP "SelectionBoxUpOrDown(\fBPrevious|Next|First|Last\fP):" 10
When called with an argument of \fBPrevious\fP, or 0 (zero) for
compatibility,
selects the previous item in the history
list and replaces the text with that item\&.
.IP "" 10
When called with an argument of \fBNext\fP, or 1 for
compatibility, selects the next item in the history
list and replaces the text with that item\&.
.IP "" 10
When called with an argument of \fBFirst\fP, or 2 for
compatibility, selects the first item in the history
list and replaces the text with that item\&.
.IP "" 10
When called with an argument of \fBLast\fP, or 3 for
compatibility, selects the last item in the history
list and replaces the text with that item\&.
.IP "" 10
Calls the callbacks for \fBXmNcommandChangedCallback\fP\&.
.SS "Additional Behavior"
.PP
The Command widget has the following additional behavior:
.IP "\fB<Key>\fP\fB<osfCancel>\fP:" 10
If the parent of the Command is a manager, the event is passed to the parent\&.
.IP "\fB<Key>\fP\fB<osfActivate>\fP\ in\ Text:" 10
Calls the Text widget\&'s \fBXmNactivateCallback\fP callbacks\&.
If the text is empty, this action then returns\&.
Otherwise, if the history list has \fBXmNhistoryMaxItems\fP items, it
removes the first item in
the list\&.
It adds the text to the history list as the last item, clears the text,
and calls the \fBXmNcommandEnteredCallback\fP callbacks\&.
.IP "\fB<Key>\fP\ in\ Text:" 10
When any change is made to the text edit widget, this action
calls the callbacks for
\fBXmNcommandChangedCallback\fP\&.
.IP "\fB<BtnDown>\fP\fB(2+)\fP\ or\ \fB<Key>\fP\fB<osfActivate>\fP\ in\ List:" 10
Calls the List widget\&'s \fBXmNdefaultActionCallback\fP callbacks\&.
If the history list has \fBXmNhistoryMaxItems\fP items, this action
removes the first item in the list\&.
It adds the selected List item to the history list as the last item,
clears the text, and calls the \fBXmNcommandEnteredCallback\fP
callbacks\&.
.IP "\fB<FocusIn>\fP:" 10
Calls the callbacks for \fBXmNfocusCallback\fP\&.
.IP "\fB<MapWindow>\fP:" 10
When a Command that is the child of a DialogShell is mapped, this action
calls the callbacks for \fBXmNmapCallback\fP\&.
.IP "\fB<UnmapWindow>\fP:" 10
When a Command that is the child of a DialogShell is unmapped, this
action calls the
callbacks for \fBXmNunmapCallback\fP\&.
.SS "Virtual Bindings"
.PP
The bindings for virtual keys are vendor specific\&.
For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&.
.SH "RELATED"
.PP
\fBComposite\fP(3), \fBConstraint\fP(3),
\fBCore\fP(3),
\fBXmBulletinBoard\fP(3),
\fBXmCommandAppendValue\fP(3),
\fBXmCommandError\fP(3),
\fBXmCommandGetChild\fP(3),
\fBXmCommandSetValue\fP(3),
\fBXmCreateCommand\fP(3),
\fBXmManager\fP(3),
\fBXmSelectionBox\fP(3),
\fBXmVaCreateCommand\fP(3), and
\fBXmVaCreateManagedCommand\fP(3)\&.