'\" 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" 3 .SH "NAME" \fBXmCommand\fP \(em The Command widget class "XmCommand" "widget class" "Command" .SH "SYNOPSIS" .PP .nf #include .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\fP\fB\fP:" 10 If the parent of the Command is a manager, the event is passed to the parent\&. .IP "\fB\fP\fB\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\fP\ in\ Text:" 10 When any change is made to the text edit widget, this action calls the callbacks for \fBXmNcommandChangedCallback\fP\&. .IP "\fB\fP\fB(2+)\fP\ or\ \fB\fP\fB\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\fP:" 10 Calls the callbacks for \fBXmNfocusCallback\fP\&. .IP "\fB\fP:" 10 When a Command that is the child of a DialogShell is mapped, this action calls the callbacks for \fBXmNmapCallback\fP\&. .IP "\fB\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)\&.