Blame doc/man/man3/XmDropDown.3

Packit b099d7
.DT
Packit b099d7
.TH "XmDropDown" "library call"
Packit b099d7
.SH NAME
Packit b099d7
\fBXmDropDown\fP \(em The DropDown widget class
Packit b099d7
.SH "SYNOPSIS"
Packit b099d7
.PP
Packit b099d7
.nf
Packit b099d7
#include <Xm/DropDown\&.h>
Packit b099d7
.fi
Packit b099d7
.SH DESCRIPTION
Packit b099d7
.PP
Packit b099d7
The DropDown widget allows the user to select elements from a list of choices, 
Packit b099d7
and enter their own values in a text widget. To conserve screen space, the list of choices 
Packit b099d7
is shown only when the user selects the down arrow button. The choices may then be 
Packit b099d7
selected from this list. If the list widget is in Browse Select mode (the default) or Single 
Packit b099d7
Select mode, then the list will automatically be removed when the user selects an item 
Packit b099d7
in the list. When the list is in other modes, multiple items may be selected and the list 
Packit b099d7
may be popped down by either another click on the arrow button, a click outside the 
Packit b099d7
list or double-clicking an item. When using keyboard traversal, the list may be popped 
Packit b099d7
down by selecting the arrow button or Alt - down arrow, and popped back up by typing either 
Packit b099d7
the osfActivate key, a carriage return, or Alt - up arrow. In any case, when 
Packit b099d7
the list is removed the item or items that were selected will be placed in the text widget 
Packit b099d7
separated by commas. Typing the escape key when the list is up, cancels the list popup, 
Packit b099d7
restoring the DropDown widget to the state it was in before the list was popped up. If
Packit b099d7
the text field area is non-editable, clicking anywhere in the text field the list will
Packit b099d7
also pop down.
Packit b099d7
.PP
Packit b099d7
Resources are available to change the margin sizes, the location of the left edge of the 
Packit b099d7
popup list, whether or not the label is shown, whether the text field widget may be 
Packit b099d7
edited, and whether or not the text in the list is verified against the choices available in 
Packit b099d7
the list. By setting resources that occur in the children of the DropDown widget, the 
Packit b099d7
contents of the list, the number of items visible in the list, the initial value of the text 
Packit b099d7
field, and the value of the label may be set or changed dynamically.
Packit b099d7
.PP
Packit b099d7
If a developer wishes the popup list's shell to be resizable, they should set the
Packit b099d7
allowShellResize to True at creation time.
Packit b099d7
.SS "Classes"
Packit b099d7
.PP
Packit b099d7
\fBXmDropDown\fP inherits behavior, resources, and traits from \fBCore\fP,
Packit b099d7
\fBComposite\fP, and \fBXmManager\fP classes\&.
Packit b099d7
.PP
Packit b099d7
The class pointer is \fBxmDropDownWidgetClass\fP\&.
Packit b099d7
.PP
Packit b099d7
The class name is \fBXmDropDown\fP\&.
Packit b099d7
.PP
Packit b099d7
.SS "New Resources"
Packit b099d7
.PP
Packit b099d7
The following table defines a set of widget resources used by
Packit b099d7
the programmer to specify data\&. The programmer can also set the
Packit b099d7
resource values for the inherited classes to set attributes for
Packit b099d7
this widget\&. To reference a resource by name or by class in
Packit b099d7
a \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and
Packit b099d7
use the
Packit b099d7
remaining letters\&. To specify one of the defined values for a
Packit b099d7
resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\fP prefix and use the
Packit b099d7
remaining letters (in either lowercase or uppercase, but
Packit b099d7
include any underscores between words)\&. The codes in the
Packit b099d7
access column indicate if the given resource can be at
Packit b099d7
creation time (C), set by using \fBXtSetValues\fP (S), retrieved by
Packit b099d7
using \fBXtGetValues\fP (G), or is not applicable (N/A)\&.
Packit b099d7
.TS
Packit b099d7
tab(?) box;
Packit b099d7
c s s s s
Packit b099d7
l| l| l| l| l.
Packit b099d7
\fBXmDropDown Resource Set\fP
Packit b099d7
\fBName\fP?\fBClass\fP?\fBType\fP?\fBDefault\fP?\fBAccess\fP
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNcustomizedCombinationBox?XmCBoolean?Boolean?False?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNeditable?XmCBoolean?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNhorizontalMargin?XmCMargin?Dimension?2?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNitemCount?list?int?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNitems?list?XmStringTable?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNlabelString?label?XmString?"label"?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNpopupCursor?XmCCursor?Cursor?left_ptr?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNpopupOffset?MxCPopupOffset?int?15?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNpopupShellWidget?XmCWidget?Widget?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNshowLabel?XmCBoolean?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNupdateShellCallback?XmCCallback?XtCallbackList?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNupdateTextCallback?XmCCallback?XtCallbackList?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNuseTextField?XmCUseTextField?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNvalue?text?String?""?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNverify?XmCVerify?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNverifyTextCallback?XmCCallback?XtCallbackList?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNverticalMargin?XmCMargin?Dimension?2?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNvisibleItemCount?XmCVisibleItemCount?int?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
.TE
Packit b099d7
.IP "\fBXmNcustomizedCombinationBox\fP" 10
Packit b099d7
If this resource is True then the widget will not automatically create a popup shell 
Packit b099d7
and list widget. This resource can be used, as the name implies, to create a custom 
Packit b099d7
combination box that has something other than a list in it. If this resource is true 
Packit b099d7
then a shell must be provided to the DropDown widget via the popupShellWidget 
Packit b099d7
resource. Just before the shell is popped up the updateShellCallback is called. Just 
Packit b099d7
after the shell is popped down the updateTextCallback is called. If verify is true 
Packit b099d7
then the verifyTextCallback is called when the combo box needs to verify the 
Packit b099d7
contents of the text widget against the allowable values in the custom shell. 
Packit b099d7
.IP "\fBXmNeditable\fP" 10
Packit b099d7
This boolean value determines whether the user is allowed to type into 
Packit b099d7
TextField widget of the DropDown widget. If this value is False, selecting the text
Packit b099d7
field will popup the combo box list
Packit b099d7
.IP "\fBXmNhorizontalMargin\fP" 10
Packit b099d7
Specifies the horizontal spacing between the child widgets and the boundary
Packit b099d7
of the DropDown widget\&.
Packit b099d7
.IP "\fBXmNverticalMargin\fP" 10
Packit b099d7
Specifies the vertical spacing between the child widgets and the boundary
Packit b099d7
of the DropDown widget\&.
Packit b099d7
.IP "\fBXmNitemCount\fP" 10
Packit b099d7
The number of items in the popup list.
Packit b099d7
.IP "\fBXmNitems\fP" 10
Packit b099d7
The list of all choice that will be displayed in the popup list.
Packit b099d7
.IP "\fBXmNlabelString\fP" 10
Packit b099d7
The string displayed as the label of the DropDown widget.
Packit b099d7
.IP "\fBXmNpopupCursor\fP" 10
Packit b099d7
The cursor to display to the user when the DropDown's list is popped up. 
Packit b099d7
See X Window System, Robert Scheiffler et al., Appendix B, for choices.
Packit b099d7
.IP "\fBXmNpopupOffset\fP" 10
Packit b099d7
The amount of space in pixels between the left edge of the Text widget and the left 
Packit b099d7
edge of the list when the list is displayed. Positive values mean the text's left edge 
Packit b099d7
is farther to the left, negative values mean the list's edge is farther to the left. If this 
Packit b099d7
is a non-custom DropDown widget the right edge of the text and the right edge of 
Packit b099d7
the arrow button will always line up.
Packit b099d7
.IP "\fBXmNpopupShellWidget\fP" 10
Packit b099d7
The widget identifier for the shell that is popped up when the arrow is clicked. If 
Packit b099d7
customizedCombinationBox is False then this widget is automatically created 
Packit b099d7
by the DropDown widget.
Packit b099d7
.IP "\fBXmNshowLabel\fP" 10
Packit b099d7
A boolean value that specifies whether or not to display the DropDown 
Packit b099d7
Label widget.
Packit b099d7
.IP "\fBXmNupdateShellCallback\fP" 10
Packit b099d7
.IP "\fBXmNupdateTextCallback\fP" 10
Packit b099d7
The callback routine to call when either the shell widget contents or the Text 
Packit b099d7
widget need to be updated to correspond with the other. The shell is updated just 
Packit b099d7
before it is popped up. The text is updated just after the shell is popped down. If 
Packit b099d7
customizedComboBox is False then the updates are done automatically by the 
Packit b099d7
combo box. These routines are called to inform the application that an action has 
Packit b099d7
been taken, in case it would like to do any further processing.
Packit b099d7
.IP "\fBXmNuseTextField\fP" 10
Packit b099d7
A boolean value that specifies if an XmTextField or an XmText widget
Packit b099d7
should be used for the text entry portion of the DropDown widget.
Packit b099d7
.IP "\fBXmNvalue\fP" 10
Packit b099d7
The string displayed in the Text widget.
Packit b099d7
.IP "\fBXmNverify\fP" 10
Packit b099d7
If this resource is true the DropDown widget will verify its value against the list 
Packit b099d7
whenever it loses focus or the user types <Carriage Return>. If the verification 
Packit b099d7
fails, an XtWarning is generated with a name of XmNtextVerifyFailed. To trap this 
Packit b099d7
message register an XtWarningMsgHandler.
Packit b099d7
.IP "\fBXmNverifyTextCallback\fP" 10
Packit b099d7
This routine is called whenever the Text widget's contents may need to be verified 
Packit b099d7
against the popup shell's contents. If the customizedComboBox resource is False 
Packit b099d7
then the DropDown widget has already performed the verification when this 
Packit b099d7
routine is called.
Packit b099d7
.IP "\fBXmNvisibleItemCount\fP" 10
Packit b099d7
The number of items visible in the popup list at one time.
Packit b099d7
.RE
Packit b099d7
.SS Children
Packit b099d7
.PP
Packit b099d7
The DropDown is composed of many sub-widgets. Most of the information 
Packit b099d7
displayed to the user is set through these sub widgets. Most 
Packit b099d7
values passed to this widget through the argument list at creation time or via set values 
Packit b099d7
are passed to each of this widget's children. Get values requests must be made on a 
Packit b099d7
child by child basis. The children of the DropDown are listed below. The 
Packit b099d7
OSF/Motifdocumentation should be consulted for an exhaustive set of resources for each child.
Packit b099d7
A partial list of the most common resources are listed here for convenience.
Packit b099d7
.PP
Packit b099d7
.ta 18n 35n 40n 50n
Packit b099d7
.df
Packit b099d7
Packit b099d7
Packit b099d7
XmDropDown	comboBox
Packit b099d7
Packit b099d7
	XmLabel	label
Packit b099d7
Packit b099d7
	XmTextField	text
Packit b099d7
Packit b099d7
	XmArrowButton	arrow
Packit b099d7
Packit b099d7
	OverrideShell	popupShell
Packit b099d7
Packit b099d7
	XmScrolledWindow	listSW
Packit b099d7
Packit b099d7
		XmScrollBar	ListvScrollBar
Packit b099d7
Packit b099d7
		XmScrollBar	ListhScrollBar
Packit b099d7
Packit b099d7
		XmList	list
Packit b099d7
.fi
Packit b099d7
Packit b099d7
The popup shell and its children are only created when 
Packit b099d7
customizedCombinationBox is False.
Packit b099d7
.PP
Packit b099d7
.SS "Inherited Resources"
Packit b099d7
.PP
Packit b099d7
XmDropDown inherits behavior and resources from the
Packit b099d7
superclasses described in the following tables\&.
Packit b099d7
For a complete description of each resource, refer to the
Packit b099d7
reference page for that superclass\&.
Packit b099d7
.PP
Packit b099d7
.TS
Packit b099d7
tab(?) box;
Packit b099d7
c s s s s
Packit b099d7
l| l| l| l| l.
Packit b099d7
\fBXmManager Resource Set\fP
Packit b099d7
\fBName\fP?\fBClass\fP?\fBType\fP?\fBDefault\fP?\fBAccess\fP
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNbottomShadowColor?XmCBottomShadowColor?Pixel?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNbottomShadowPixmap?XmCBottomShadowPixmap?Pixmap?XmUNSPECIFIED_PIXMAP?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNforeground?XmCForeground?Pixel?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNhelpCallback?XmCCallback?XtCallbackList?NULL?C
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNhighlightColor?XmCHighlightColor?Pixel?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNhighlightPixmap?XmCHighlightPixmap?Pixmap?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNinitialFocus?XmCInitialFocus?Widget?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNlayoutDirection?XmCLayoutDirection?XmDirection?dynamic?CG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNnavigationType?XmCNavigationType?XmNavigationType?XmTAB_GROUP?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNpopupHandlerCallback?XmCCallback?XtCallbackList?NULL?C
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNshadowThickness?XmCShadowThickness?Dimension?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNstringDirection?XmCStringDirection?XmStringDirection?dynamic?CG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNtopShadowColor?XmCTopShadowColor?Pixel?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNtopShadowPixmap?XmCTopShadowPixmap?Pixmap?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNtraversalOn?XmCTraversalOn?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNunitType?XmCUnitType?unsigned char?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNuserData?XmCUserData?XtPointer?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
.TE
Packit b099d7
.PP
Packit b099d7
.TS
Packit b099d7
tab(?) box;
Packit b099d7
c s s s s
Packit b099d7
l| l| l| l| l.
Packit b099d7
\fBComposite Resource Set\fP
Packit b099d7
\fBName\fP?\fBClass\fP?\fBType\fP?\fBDefault\fP?\fBAccess\fP
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNchildren?XmCReadOnly?WidgetList?NULL?G
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNinsertPosition?XmCInsertPosition?XtOrderProc?NULL?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNnumChildren?XmCReadOnly?Cardinal?0?G
Packit b099d7
_?_?_?_?_?
Packit b099d7
.TE
Packit b099d7
.TS
Packit b099d7
tab(?) box;
Packit b099d7
c s s s s
Packit b099d7
l| l| l| l| l.
Packit b099d7
\fBCore Resource Set\fP
Packit b099d7
\fBName\fP?\fBClass\fP?\fBType\fP?\fBDefault\fP?\fBAccess\fP
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNaccelerators?XmCAccelerators?XtAccelerators?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNancestorSensitive?XmCSensitive?Boolean?dynamic?G
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNbackground?XmCBackground?Pixel?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNbackgroundPixmap?XmCPixmap?Pixmap?XmUNSPECIFIED_PIXMAP?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNborderColor?XmCBorderColor?Pixel?XtDefaultForeground?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNborderPixmap?XmCPixmap?Pixmap?XmUNSPECIFIED_PIXMAP?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNborderWidth?XmCBorderWidth?Dimension?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNcolormap?XmCColormap?Colormap?dynamic?CG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNdepth?XmCDepth?int?dynamic?CG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNdestroyCallback?XmCCallback?XtCallbackList?NULL?C
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNheight?XmCHeight?Dimension?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNinitialResourcesPersistent?XmCInitialResourcesPersistent?Boolean?True?C
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNmappedWhenManaged?XmCMappedWhenManaged?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNscreen?XmCScreen?Screen *?dynamic?CG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNsensitive?XmCSensitive?Boolean?True?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNtranslations?XmCTranslations?XtTranslations?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNwidth?XmCWidth?Dimension?dynamic?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNx?XmCPosition?Position?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
XmNy?XmCPosition?Position?0?CSG
Packit b099d7
_?_?_?_?_?
Packit b099d7
.TE
Packit b099d7
.SS "Callback Information"
Packit b099d7
.PP
Packit b099d7
None of the DropDown's callback procedures have any call data currently 
Packit b099d7
defined for them. The widget passed to each of these functions is the DropDown
Packit b099d7
widget.
Packit b099d7
.HP 20
Packit b099d7
void (Callback)(Widget cbw, XtPointer client_data, XtPointer unused)
Packit b099d7
.ta 15
Packit b099d7
.HP 15
Packit b099d7
cbw		This is the widget identifier of the DropDown widget.
Packit b099d7
.PP
Packit b099d7
.HP 15
Packit b099d7
client_data		The client data passed to this widget by the application programmer.
Packit b099d7
.HP 15
Packit b099d7
unused		This value is undefined.
Packit b099d7
.PP
Packit b099d7
.SS "Geometry Management"
Packit b099d7
.PP
Packit b099d7
The DropDown widget lays out its children (the label, text and arrow) in a row. 
Packit b099d7
The amount of space they are each allocated when the DropDown is not allowed 
Packit b099d7
to be the exact size it desires is determined using the following rules:
Packit b099d7
.ta 5
Packit b099d7
.HP 5
Packit b099d7
1.	The arrow is always given its requested size.
Packit b099d7
.HP 5
Packit b099d7
2.	If the combo box is bigger than it wants to be all extra space is given to the text 
Packit b099d7
widget.
Packit b099d7
.HP 5
Packit b099d7
3.	If the combo box is smaller that is wants to be then the text and label widgets 
Packit b099d7
are each sized smaller than they desire in exactly the same ratio.
Packit b099d7
Packit b099d7
For example:
Packit b099d7
Packit b099d7
If the amount of space for the label and text is 100 pixels and the label 
Packit b099d7
wants to be 50 pixels wide and the text would like to be 100 pixels wide 
Packit b099d7
then the label will get 34 pixels and the text 66.
Packit b099d7
Packit b099d7
The popup shell widget is sized such that the width of the scrolled list widget equals 
Packit b099d7
the width of the text widget minus the value of the "popupOffset" resource. If the 
Packit b099d7
popup shell resides in a customized combination box, however, it is allowed to be 
Packit b099d7
whatever size the child of the popup shell would like to be.
Packit b099d7
.PP
Packit b099d7
.SH RELATED
Packit b099d7
.PP
Packit b099d7
\fBComposite\fP(3),
Packit b099d7
\fBCore\fP(3),
Packit b099d7
\fBXmCreateDropDown\fP(3),
Packit b099d7
\fBXmDropDownGetArrow\fP(3),
Packit b099d7
\fBXmDropDownGetLabel\fP(3),
Packit b099d7
\fBXmDropDownGetList\fP(3),
Packit b099d7
\fBXmDropDownGetText\fP(3),
Packit b099d7
\fBXmDropDownGetValue\fP(3),
Packit b099d7
\fBXmList\fP(3),
Packit b099d7
\fBXmManager\fP(3),
Packit b099d7
\fBXmTextField\fP(3),
Packit b099d7
\fBXmVaCreateDropDown\fP(3), and
Packit b099d7
\fBXmVaCreateManagedDropDown\fP(3)\&.
Packit b099d7
.PP
Packit b099d7
.SH COPYRIGHT
Packit b099d7
.PP
Packit b099d7
Copyright (c) 1992 by Integrated Computer Solutions, Inc.