XmContainer (3) Linux Manual Page
XmContainer — The Container widget class
Synopsis
#include <Xm/Container.h>
Description
Container manages child widgets that have the ContainerItem trait. These child widgets can be viewed in several different layout formats, selected using different selection types and techniques, and directly manipulated by the user.
Three different formats or views are supported by the Container. They are specified via the XmNentryViewType resource:
- •
XmLARGE_ICON- •
XmSMALL_ICON- •
XmANY_ICON
Three different layout types are supported by the Container. They are specified by the XmNlayoutType resource:
- •
XmSPATIAL- •
XmOUTLINE- •
XmDETAIL
In the XmSPATIAL layout type, several other resources (XmNspatialStyle, XmNspatialIncludeModel, XmNspatialSnapModel) control the positioning of the items within the Container; an application programmer can specify these resources so that the Container strictly enforces the position of each item or so that the Container positions items according to constraint resources specified for each item. The user, however, can alter the position of an item in the XmSPATIAL layout type within the Container by direct manipulation; for example, by pressing BTransfer over the item and then dragging and releasing BTransfer over some location within the Container.
In the XmOUTLINE layout type, the Container controls the positioning of the items. Items within the Container can have parent-child relationships between them. Each item’s XmNentryParent resource can specify another item in the same Container as its parent; items with a non-NULL value for XmNentryParent can only be displayed in the XmOUTLINE layout type. In the XmOUTLINE layout type, items are positioned in a tree configuration with connecting lines drawn to illustrate the relationships. Items are positioned top to bottom in the order specified by XmNpositionIndex within their parent. Container positions a PushButton next to each item that has a parent relationship to other items. The PushButton contains a pixmap to illustrate whether the child items are shown or not; the user can activate the PushButton to toggle between showing or hiding the child items. Direct manipulation to alter the position of the item is not supported in the XmOUTLINE layout type. Note that the XmNtraversalOn resource of the PushButtons created by Container are set to False.
The XmDETAIL layout type is the same as XmOUTLINE, except that each item can also display additional information as rows in columns with column headers specified in the XmNdetailColumnHeading resources. In each item row, the item’s detail information (see the reference page on XmIconGadget for a description of the XmNentryDetail resource) is displayed. Items are positioned top to bottom in the order specified by XmNpositionIndex within the parent.
Selection
When a child widget of the container is selected, the container specifies that the item should display the appropriate visual information to the user via the ContainerItem trait. The application program is notified of selection changes through XmNselectionCallback.
The container uses four selection policies:
- •
- Single
- •
- Browse
- •
- Multiple
- •
- Extended
In Single Select and Browse Select modes, only one item can be selected at a time. Pressing BSelect on an item selects it and deselects any other selected item. Pressing BSelect over an empty space in the Container deselects all items. In Browse Select, dragging BSelect moves the selection as the pointer is moved.
In Multiple Select and Extended Select modes, any number of items can be selected at the same time. In Multiple Select, pressing and dragging BSelect or BExtend to specify an item, range of items, or group of discontiguous items causes the selection states of those items to be toggled. In Extended Select, pressing and dragging BSelect to indicate an item, range of items, or group of discontiguous items selects those items and deselects all others. Pressing and dragging BExtend in Extended Select to indicate an item, range of items, or discontiguous group of items causes the selection states of those items to be toggled.
Several techniques are available to indicate an item, range of items, or group of discontiguous items in the Multiple Select and Extended Select modes.
In the XmSPATIAL and XmOUTLINE layout types, the XmNselectionTechnique resource specifies the techniques to be used to indicate items. The default specification of XmTOUCH_OVER allows both the Random-Swipe and Marquee techniques to be used when XmNlayoutStyle is XmSPATIAL. The default specification of XmTOUCH_OVER allows the Range-Swipe, Range-Click, and Marquee techniques to be used when XmNlayoutStyle is XmOUTLINE.
Discontiguous groups of items can be selected using the Random-Swipe technique. In the Random-Swipe technique, pressing BSelect (or BExtend) over an item and dragging BSelect over other items selects all of those items. Only those items that pointer passed over are selected.
In the Range-Swipe technique, the user presses BSelect (or BExtend) over the first item and releases BSelect over the last item; all items within the range between the first and last item are selected whether the pointer actually passed over them or not. In the Range-Click technique, the user presses and releases BSelect (or BExtend) over the first item and then presses and releases BExtend over the last item.
In the Marquee technique, pressing BSelect (or BExtend) over a blank space within the Container indicates the starting point of a Marquee rectangle. Dragging BSelect draws a Marquee rectangle (rubberband line) between the starting point and current pointer. All items completely within the Marquee rectangle are selected.
Specifying XmTOUCH_ONLY for XmNselectionTechnique enforces the Random-Swipe technique even when BSelect (or BExtend) is pressed over a blank space. Similarly, specifying XmMARQUEE enforces the Marquee technique even when BSelect (or BExtend) is pressed over an item; since the item over which the press occurs is only partially included in the Marquee rectangle, it is not selected. XmMARQUEE_EXTEND_START and XmMARQUEE_EXTEND_BOTH enforce the Marquee technique and also cause the rectangle to extend automatically around the first item indicated and, for XmMARQUEE_EXTEND_BOTH, the last item.
In the XmDETAIL layout type, the Range-Swipe and Range-Click techniques are available to indicate a range of items for selection.
Container uses the XmQTcontainerItem, XmQTscrollFrame, and XmQTspecifyRenderTable traits and holds the XmQTcontainer and XmQTtransfer traits.
Data Transfer Behavior
Container supports dragging of selected items from the widget. Depending on the value of XmNprimaryOwnership, Container can also support primary selection.
As a source of data, Container supports the following targets and associated conversions of data to these targets:
- locale
- If the locale target matches the widget’s locale, the widget transfers the selected items in the encoding of the locale. The value for each item transferred, except the last, includes a trailing separator. Each item value is the
XmNlabelStringof the item. COMPOUND_TEXT- The widget transfers the selected items as type
COMPOUND_TEXT. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item. DELETE- The widget deletes the selected items.
PIXMAP- The widget transfers a list of the pixmap IDs of the selected items as type
DRAWABLE. STRING- The widget transfers the selected items as type
STRING. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item. TEXT- If the selected items are fully convertible to the encoding of the locale, the widget transfers the selected items in the encoding of the locale. Otherwise, the widget transfers the selected items as type
COMPOUND_TEXT. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item. _MOTIF_CLIPBOARD_TARGETS- The widget transfers, as type
ATOM, a list of the targets it supports for immediate transfer for theCLIPBOARDselection. These include_MOTIF_COMPOUND_STRINGandPIXMAP. If the selected items are fully convertible toSTRING, these also includeSTRING; otherwise, they also includeCOMPOUND_TEXTandUTF8_STRING. _MOTIF_COMPOUND_STRING- The widget transfers the selected items as a compound string in Byte Stream format. The value for each item transferred, except the last, includes a trailing separator. Each item value is the
XmNlabelStringof the item. UTF8_STRING- The widget transfers the selected items as type
UTF8_STRING. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item. _MOTIF_DEFERRED_CLIPBOARD_TARGETS- The widget transfers, as type
ATOM, a list of the targets it supports for delayed transfer for theCLIPBOARDselection. This widget currently supplies no targets for_MOTIF_DEFERRED_CLIPBOARD_TARGETS. _MOTIF_DRAG_OFFSET- The widget transfers a list of two 16-bit numbers, of type
INTEGER, representing an x and y offset for an item being dragged. This offset is calculated so that, if the offset were added to the x and y coordinates at the drop site, and the dragged pixmap placed at that position, it would correspond to the position the user would expect the pixmap to placed at, based on the drag icon used at the drop site. _MOTIF_EXPORT_TARGETS- The widget transfers, as type
ATOM, a list of the targets to be used as the value of the DragContext’sXmNexportTargetsin a drag-and-drop transfer. These include_MOTIF_COMPOUND_STRING,PIXMAP,COMPOUND_TEXT, the encoding of the locale,STRING,TEXT,BACKGROUND,FOREGROUND, andUTF8_STRING.
As a source of data, Container also supports the following standard Motif targets:
BACKGROUND- The widget transfers
XmNbackgroundas typePIXEL. CLASS- The widget finds the first shell in the widget hierarchy that has a
WM_CLASSproperty and transfers the contents as text in the current locale. CLIENT_WINDOW- The widget finds the first shell in the widget hierarchy and transfers its window as type
WINDOW. COLORMAP- The widget transfers
XmNcolormapas typeCOLORMAP. FOREGROUND- The widget transfers
XmNforegroundas typePIXEL. NAME- The widget finds the first shell in the widget hierarchy that has a
WM_NAMEproperty and transfers the contents as text in the current locale. TARGETS- The widget transfers, as type
ATOM, a list of the targets it supports. These include the standard targets in this list. These also include_MOTIF_COMPOUND_STRING,PIXMAP,COMPOUND_TEXT, the encoding of the locale,STRING,TEXT, andUTF8_STRING. TIMESTAMP- The widget transfers the timestamp used to acquire the selection as type
INTEGER. _MOTIF_RENDER_TABLE- The widget transfers
XmNrenderTableif it exists, or else the default text render table, as typeSTRING. _MOTIF_ENCODING_REGISTRY- The widget transfers its encoding registry as type
STRING. The value is a list of NULL separated items in the form of tag encoding pairs. This target symbolizes the transfer target for the Motif Segment Encoding Registry. Widgets and applications can use this Registry to register text encoding formats for specified render table tags. Applications access this Registry by callingXmRegisterSegmentEncodingandXmMapSegmentEncoding.
As a destination for data, Container supports only the dropping of items being dragged from the same widget. Subclasses and the XmNdestinationCallback procedures are responsible for any other data transfers to the widget.
Classes
Container inherits behavior, resources, and traits from the Core, Composite, Constraint, and XmManager classes.
The class pointer is xmContainerWidgetClass.
The class name is XmContainer.
New Resources
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 .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate whether the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XmNautomaticSelection- Indicates whether the Container invokes selection callbacks when each item is selected (or toggled) or whether selection callbacks are not invoked until the user has completed selection actions (for example, the user has released the mouse button). It can have one of the following values:
-
XmAUTO_SELECT- Makes selection callbacks automatically when each item is selected or toggled. This may also be the value
TRUE. XmNO_AUTO_SELECT- Delays selection callbacks until the user has finished selection actions. This may also be the value
FALSE.
-
XmNcollapsedStatePixmap- Specifies the pixmap to display on a PushButton next to a Container item with child items, when
XmNoutlineButtonPolicyisXmOUTLINE_BUTTON_PRESENT.XmNcollapsedStatePixmapindicates that the child items are not displayed. If set toXmUNSPECIFIED_PIXMAP, a default pixmap showing an arrow pointing up is used. XmNconvertCallback- Specifies a list of callbacks called when the Container is asked to convert a selection. The type of the structure whose address is passed to these callbacks is
XmConvertCallbackStruct. The reason isXmCR_OK. XmNdefaultActionCallback- Specifies a list of callbacks to call when the user double-clicks an item or presses
<Enter>or<Return>over an item. The callback structure isXmContainerSelectCallbackStruct. The reason isXmCR_DEFAULT_ACTION. XmNdestinationCallback- Specifies a list of callbacks called when the Container is the destination of a transfer operation. The type of the structure whose address is passed to these callbacks is
XmDestinationCallbackStruct. The reason isXmCR_OK. XmNdetailColumnHeading- Specifies a table of
XmStrings to display as the headings to columns. If NULL, or ifXmNlayoutTypeis notXmDETAIL, no heading is displayed. XmNdetailColumnHeadingCount- Specifies a count of
XmStrings in the table specified forXmNdetailColumnHeading. XmNdetailOrder- Specifies an array of
Cardinals that indicate which column detail information, and in which order, each Container child will display its detail information. This resource is ignored ifXmNlayoutTypeis notXmDETAIL. If NULL, the the default behavior is determined byXmNdetailOrderCount. XmNdetailOrderCount- Specifies a count of
Cardinals in the array specified forXmNdetailOrder. IfXmNdetailOrderis NULL andXmNdetailOrderCountis not 0, then each Container child displays its detail information in order from column 1 to theXmNdetailOrderCountcolumn number. IfXmNdetailOrderCountis 0, then a default is calculated from the detail order count information of each item accessed via theContainerItemtrait. XmNdetailTabList- Indicates an
XmTabListspecifying the start of each column in theXmDETAILlayout. If this resource is set to NULL, then Container calculates anXmTabList. This resource is ignored ifXmNlayoutTypeis notXmDETAIL. XmNentryViewType- Specifies the view type for all Container children. The view type is specified for each item via the
ContainerItemtrait. It can have one of the following values:-
XmANY_ICON- No specification is made for Container children. Children use their own default specifications.
XmLARGE_ICON- The view type for all children is
XmLARGE_ICON. XmSMALL_ICON- The view type for all children is
XmSMALL_ICON.
-
XmNexpandedStatePixmap- Specifies the pixmap to display on a PushButton next to a Container item with child items, when
XmNoutlineButtonPolicyisXmOUTLINE_BUTTON_PRESENT.XmNexpandedStatePixmapindicates that the child items are displayed. If set toXmUNSPECIFIED_PIXMAP, a default pixmap showing an arrow pointing down is used. XmNfontList- Specifies the fontlist associated with
XmContainer. The fontlist is an obsolete construct and has been superseded by the render table. It is included for compatibility with earlier versions of Motif, and for applications that do not easily support render tables. The default fontlist is derived from the default render table; and if both a fontlist and a render table are specified, the render table takes precedence. XmNlargeCellHeight- Specifies the height of a cell for
XmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmLARGE_ICONorXmANY_ICON. XmNlargeCellWidth- Specifies the width of a cell for
XmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmLARGE_ICONorXmANY_ICON. XmNlayoutType- Specifies the policy for laying out child widgets within the Container. It can have one of the following values:
-
XmDETAIL- Displays items in the same manner as when the resource is
XmOUTLINE, except that each item displays detail information next to it. XmOUTLINE- Displays items in a tree configuration, in
XmNpositionIndexwithinXmNentryParentorder, with connecting lines drawn to show their parent-child relationships. XmSPATIAL- Displays items according to
XmNspatialStyle. Items withXmNentryParentvalues are not displayed.
-
XmNmarginHeight- Specifies the margin spacing at the top and bottom of the Container.
XmNmarginWidth- Specifies the margin spacing at the left and right sides of the Container.
XmNoutlineButtonPolicy- Specifies whether or not to display buttons for users to expand and collapse the display of items. It can have one of the following values:
-
XmOUTLINE_BUTTON_ABSENT- Do not display the outline buttons.
XmOUTLINE_BUTTON_PRESENT- Display the outline buttons.
-
XmNoutlineChangedCallback- Specifies a list of callbacks to call when an item’s
XmNoutlineStateis changed. The callback structure isXmContainerOutlineCallbackStruct. The reason isXmCR_COLLAPSEDorXmCR_EXPANDED, depending on the new value ofXmNoutlineState. XmNoutlineColumnWidth- Specifies the width of the first column displayed when
XmNlayoutTypeisXmDETAIL. Specifies the preferred width of the Container (without the margins) whenXmNlayoutTypeisXmOUTLINE. If not specified, Container will determine a default value equal to the widest space necessary to display an item’s pixmap andXmNoutlineIndentation. XmNoutlineIndentation- Specifies the distance to indent for the display of child items when
XmNlayoutTypeisXmOUTLINEorXmDETAIL. XmNoutlineLineStyle- Specifies whether to draw lines between items with parent-child relationships when
XmNlayoutTypeisXmOUTLINEorXmDETAIL. It can have one of the following values:-
XmNO_LINE- Draws no line.
XmSINGLE- Draws a line one pixel wide.
-
XmNprimaryOwnership- Specifies whether Container takes ownership of the primary selection when a selection is made inside it. This resource can take the following values:
-
XmOWN_NEVER- Never takes ownership.
XmOWN_ALWAYS- Always takes ownership.
XmOWN_MULTIPLE- Only takes ownership if more than one element has been selected.
XmOWN_POSSIBLE_MULTIPLE- Only takes ownership if more than one element can be selected at a time.
-
XmNrenderTable- Specifies the
XmRenderTablethat is inherited by all children of the Container. The default is implementation dependent. If both a render table and a fontlist are specified, the render table will take precedence. XmNselectColor- Specifies a Pixel that can be accessed by children of the Container and used to indicate that the child is in a selected state. In addition to a Pixel value, the following symbolic values can be specified:
-
XmDEFAULT_SELECT_COLOR- Specifies a color between the background and the bottom shadow color.
XmREVERSED_GROUND_COLORS- Forces the select color to the foreground color and causes the default color of any text rendered over the select color to be the background color.
HIGHLIGHT_COLOR- Forces the fill color to use the highlight color.
-
XmNselectedObjectCount- Specifies the number of widgets in the selected items list. The value must be the number of items in
XmNselectedObjects. XmNselectedObjects- An array of widgets that represents the Container items that are currently selected, either by the user or by the application.
- If the application sets
XmNselectedObjectsto an array of widgets, those array elements that are valid Container items are selected. - If the application sets
XmNselectionCallback- Specifies a list of callbacks to call when an item is selected. The callback structure is
XmContainerSelectCallbackStruct. The reason isXmCR_SINGLE_SELECT,XmCR_BROWSE_SELECT,XmCR_MULTIPLE_SELECT, orXmCR_EXTENDED_MULTIPLE, depending onXmNselectionPolicy. XmNselectionPolicy- Defines the interpretation of the selection action. This can be one of the following values:
-
XmSINGLE_SELECT- Allows only single selections.
XmBROWSE_SELECT- Allows "drag and browse" selections.
XmMULTIPLE_SELECT- Allows multiple selections.
XmEXTENDED_SELECT- Allows extended selections.
-
XmNselectionTechnique- Specifies the selection technique to use when the Container displays items in a 2-dimensional layout (
XmNentryViewTypeisXmLARGE_ICONorXmSMALL_ICON). In theXmDETAILlayout, theXmNselectionTechniqueresource is treated asXmTOUCH_ONLY. In either case, it can have one of the following values:-
XmMARQUEE- Uses the Marquee technique only.
XmMARQUEE_EXTEND_START- Uses the Marquee technique only and extends the Marquee rectangle around any item under the Marquee start point.
XmMARQUEE_EXTEND_BOTH- Uses the Marquee technique only and extends the Marquee rectangle around any items under the Marquee start and end points.
XmTOUCH_ONLY- Uses the Random-Swipe technique only if
XmNlayoutTypeisXmSPATIAL. Otherwise, uses the Range-Swipe and Range-Click techniques. XmTOUCH_OVER- If the selection action begins over an item and
XmNlayoutTypeisXmSPATIAL, uses the Random-Swipe technique. If the selection action begins over an item andXmNlayoutTypeisXmOUTLINEorXmDETAIL, uses the Range-Swipe and Range-Click techniques. Uses the Marquee technique if the select action begins over an unoccupied area in the Container.
-
XmNsmallCellHeight- Specifies the height of a cell for
XmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmSMALL_ICON. XmNsmallCellWidth- Specifies the width of a cell for
XmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmSMALL_ICON. XmNspatialIncludeModel- Specifies the layout of an item when the item is managed in the Container when
XmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLS. It can have one of the following values:-
XmAPPEND- Places the item after the last occupied cell according to
XmNlayoutDirection. XmCLOSEST- Places the item in the free cell closest to the position specified by
XmNxandXmNy. XmFIRST_FIT- Places the item in the first free cell according to
XmNlayoutDirection.
-
XmNspatialResizeModel- Specifies how Container will attempt to grow its dimensions when
XmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLSand there are not enough cells to contain a new Container item. It can have one of the following values:-
XmGROW_BALANCED- Container will request both width and height growth from its parent.
XmGROW_MAJOR- Container will request growth in its major dimension from its parent. Container’s major dimension is width when the precedence of
XmNlayoutDirectionis horizontal, and height when vertical. XmGROW_MINOR- Container will request growth in its minor dimension from its parent. Container’s minor dimension is height when the precedence of
XmNlayoutDirectionis horizontal, and width when vertical.
-
XmNspatialSnapModel- Specifies how Container will position an item within the cell layout when
XmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLS. It can have one of the following values:-
XmCENTER- Center the items as follows, depending on the value of
XmNentryViewType:-
XmLARGE_ICON- The child is centered in the cell horizontally and baseline-aligned vertically.
XmSMALL_ICON- The child is centered in the cell vertically on its baseline and aligned with the left or right of the cell horizontally, depending on the value of
XmNlayoutDirection.
-
XmSNAP_TO_GRID- Position the item at the upper-left or upper-right corner of the cell(s), depending on the value of
XmNlayoutDirection. XmNONE- Position the item according to the position specified by
XmNxandXmNy. If the position is not within the coordinates of the cell(s), then position the item at the upper-left or upper-right corner of the cell(s), depending on the value ofXmNlayoutDirection.
-
XmNspatialStyle- Specifies the layout of Container items when
XmNlayoutTypeisXmSPATIAL. It can have one of the following values:-
XmCELLS- Lays out items within a grid of same-size cells. Each item occupies as many cells as required to contain the item dimensions.
XmGRID- Lays out items within a grid of same-size cells. Each item occupies only one cell. Items that are larger than the cell size may overlap other items.
XmNONE- Lays out items according to
XmNxandXmNy.
-
| |||||||||||||||||||||||||||||||||||||||||||||
XmNentryParent- Specifies the widget that is this item’s logical parent. A value of NULL indicates that this is a root-level item. Parent-child information is displayed only when the
XmNlayoutPolicyisXmOUTLINEorXmDETAIL. XmNoutlineState- Specifies whether to display child items when
XmNlayoutPolicyisXmOUTLINEorXmDETAIL. It can have one of the following values:-
XmCOLLAPSED- Does not display child items.
XmEXPANDED- Displays child items.
-
XmNpositionIndex- Specifies the order of items in the Container for display. When
XmNlayoutTypeisXmOUTLINEorXmDETAIL, items are displayed inXmNpositionIndexorder withinXmNentryParent. Items that have anXmNentryParentresource are ignored whenXmNlayoutTypeisXmSPATIAL. IfXmNpositionIndexis not specified, it defaults to theXmNpositionIndexvalue plus 1 of the item with the highestXmNpositionIndexthat has the sameXmNentryParentif such an item exists; otherwise, it defaults to 0.
Inherited Resources
Container 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.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Callback Information
A pointer to the following structure is passed to callbacks for XmNoutlineChangedCallback.
typedef struct
{
int reason;
XEvent * event;
Widget item;
unsigned char new_outline_state;
} XmContainerOutlineCallbackStruct;
- reason
- Specifies the reason for the callback.
- event
- Points to the
XEventthat triggered the callback. It can be NULL. - item
- Specifies the container item affected by the event.
- new_outline_state
- Specifies the next
XmNoutlineStatefor item. The user can change this value in the callback.
A pointer to the following structure is passed to callbacks for XmNdefaultActionCallback and XmNselectionCallback.
typedef struct
{
int reason;
XEvent * event;
WidgetList selected_items;
int selected_item_count;
unsigned char auto_selection_type;
} XmContainerSelectCallbackStruct;
- reason
- Specifies the reason for the callback. It corresponds to the
XmNselectionPolicyat the time the selection was made, or indicates that the default action should be taken. - event
- Points to the
XEventthat triggered the callback. It can be NULL. - selected_items
- Specifies a list of items selected at the time of the event that caused the callback. The selected_items field points to a temporary storage space that is reused after the callback is finished. Therefore, if an application needs to save the selected list, it should copy the list into its own data space.
- selected_item_count
- Specifies the number of items in the selected_items list. This number must be positive or 0 (zero).
auto_selection_type- Indicates the cause of the selection when
XmNautomaticSelectionisXmAUTO_SELECT. Valid values are the following:-
XmAUTO_UNSET- Returned when
XmNautomaticSelectionisXmNO_AUTO_SELECT. XmAUTO_BEGIN- Indicates the beginning of automatic selection.
XmAUTO_MOTION- Indicates that there is a button drag selection.
XmAUTO_CANCEL- Indicates that the new selection is canceled.
XmAUTO_NO_CHANGE- Indicates that the currently selected item matches the initial item.
XmAUTO_CHANGE- Indicates that the currently selected item does not match the initial item.
-
A pointer to the following structure is passed to the XmNconvertCallback procedures:
typedef struct
{
int reason;
XEvent *event;
Atom selection;
Atom target;
XtPointer source_data;
XtPointer location_data;
int flags;
XtPointer parm;
int parm_format;
unsigned long parm_length;
int status;
XtPointer value;
Atom type;
int format;
unsigned long length;
} XmConvertCallbackStruct;
- reason
- Indicates why the callback was invoked.
- event
- Points to the
XEventthat triggered the callback. It can be NULL. - selection
- Indicates the selection for which conversion is being requested. Possible values are
CLIPBOARD,PRIMARY,SECONDARY, and_MOTIF_DROP. - target
- Indicates the conversion target.
- source_data
- Contains information about the selection source. When the selection is
_MOTIF_DROP, source_data is the DragContext. Otherwise, it is NULL. location_data- Contains information about the location of data to be converted. If the value is NULL, the data to be transferred consists of the widget’s current selection. Otherwise, it is the widget ID of the item being transferred, or the widget ID of the Container if all items are being transferred.
- flags
- Indicates the status of the conversion. Following are the possible values:
-
XmCONVERTING_NONE- This flag is currently unused.
XmCONVERTING_PARTIAL- The target widget was able to be converted, but some data was lost.
XmCONVERTING_SAME- The conversion target is the source of the data to be transferred.
XmCONVERTING_TRANSACT- This flag is currently unused.
-
- parm
- Contains parameter data for this target. If no parameter data exists, the value is NULL.
- When selection is
CLIPBOARDand target is_MOTIF_CLIPBOARD_TARGETSor_MOTIF_DEFERRED_CLIPBOARD_TARGETS, the value is the requested operation (XmCOPY,XmMOVE, orXmLINK). - When selection is
- parm_format
- Specifies whether the data in parm should be viewed as a list of char, short, or long quantities. Possible values are 0 (when parm is NULL), 8 (when the data in parm should be viewed as a list of chars), 16 (when the data in parm should be viewed as a list of shorts), or 32 (when the data in parm should be viewed as a list of longs). Note that parm_format symbolizes a data type, not the number of bits in each list element. For example, on some machines, a parm_format of 32 means that the data in parm should be viewed as a list of 64-bit quantities, not 32-bit quantities.
- parm_length
- Specifies the number of elements of data in parm, where each element has the size specified by parm_format. When parm is NULL, the value is 0.
- status
- An IN/OUT member that specifies the status of the conversion. The initial value is
XmCONVERT_DEFAULT. The callback procedure can set this member to one of the following values:-
XmCONVERT_DEFAULT- The widget class conversion procedure, if any, is called after the callback procedures return. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in the value member.
XmCONVERT_MERGE- The widget class conversion procedure, if any, is called after the callback procedures return. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in the value member. This value is intended for use with targets that result in lists of data, such as
TARGETS. XmCONVERT_DONE- The callback procedure has successfully finished the conversion. The widget class conversion procedure, if any, is not called after the callback procedures return.
XmCONVERT_REFUSE- The callback procedure has terminated the conversion process without completing the requested conversion. The widget class conversion procedure, if any, is not called after the callback procedures return.
-
- value
- An IN/OUT parameter that contains any data that the callback procedure produces as a result of the conversion. The initial value is NULL. If the callback procedure sets this member, it must ensure that the type, format, and length members correspond to the data in value. The callback procedure is responsible for allocating, but not for freeing, memory when it sets this member.
- type
- An IN/OUT parameter that indicates the type of the data in the value member. The initial value is
INTEGER. - format
- An IN/OUT parameter that specifies whether the data in value should be viewed as a list of char, short, or long quantities. The initial value is 8. The callback procedure can set this member to 8 (for a list of char), 16 (for a list of short), or 32 (for a list of long).
- length
- An IN/OUT member that specifies the number of elements of data in value, where each element has the size symbolized by format. The initial value is 0 (zero).
A pointer to the following callback structure is passed to the XmNdestinationCallback procedures:
typedef struct
{
int reason;
XEvent *event;
Atom selection;
XtEnum operation;
int flags;
XtPointer transfer_id;
XtPointer destination_data;
XtPointer location_data;
Time time;
} XmDestinationCallbackStruct;
- reason
- Indicates why the callback was invoked.
- event
- Points to the
XEventthat triggered the callback. It can be NULL. - selection
- Indicates the selection for which data transfer is being requested. Possible values are
CLIPBOARD,PRIMARY,SECONDARY, and_MOTIF_DROP. - operation
- Indicates the type of transfer operation requested.
-
- •
- When the selection is
PRIMARY, possible values areXmMOVE,XmCOPY, andXmLINK. - •
- When the selection is
SECONDARYorCLIPBOARD, possible values areXmCOPYandXmLINK. - •
- When the selection is
_MOTIF_DROP, possible values areXmMOVE,XmCOPY,XmLINK, andXmOTHER. A value ofXmOTHERmeans that the callback procedure must get further information from theXmDropProcCallbackStructin the destination_data member.
-
- flags
- Indicates whether or not the destination widget is also the source of the data to be transferred. Following are the possible values:
-
XmCONVERTING_NONE- The destination widget is not the source of the data to be transferred.
XmCONVERTING_SAME- The destination widget is the source of the data to be transferred.
-
transfer_id- Serves as a unique ID to identify the transfer transaction.
- destination_data
- Contains information about the destination. When the selection is
_MOTIF_DROP, the callback procedures are called by the drop site’sXmNdropProc, and destination_data is a pointer to theXmDropProcCallbackStructpassed to theXmNdropProcprocedure. When the selection isSECONDARY, destination_data is an Atom representing a target recommmended by the selection owner for use in converting the selection. Otherwise, destination_data is NULL. location_data- Contains information about the location where data is to be transferred. The value is always NULL when the selection is
SECONDARYorCLIPBOARD. If the value is NULL, the data is to be inserted at the widget’s cursor position. Otherwise, the value is a pointer to anXPointstructure containing the x and y coordinates at the location where the data is to be transferred. OnceXmTransferDoneprocedures start to be called,location_datawill no longer be stable. - time
- Indicates the time when the transfer operation began.
Translations
The XmContainer translations are listed below.
The following key names are listed in the X standard key event translation table syntax. This format is the one used by Motif to specify the widget actions corresponding to a given key. A brief overview of the format is provided under VirtualBindings(3). For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation.
≈c ≈s ≈m ≈a<Btn1Down>:- ContainerBeginSelect()
<Btn1Motion>:- ContainerButtonMotion()
≈c ≈s ≈m ≈a<Btn1Up>:- ContainerEndSelect()
c ≈s ≈m ≈a<Btn1Down>:- ContainerBeginToggle()
c ≈s ≈m ≈a<Btn1Up>:- ContainerEndToggle()
≈c s ≈m ≈a<Btn1Down>:- ContainerBeginExtend()
≈c s ≈m ≈a<Btn1Up>:- ContainerEndExtend()
c s ≈m ≈a<Btn1Down>:- ContainerBeginExtend()
c s ≈m ≈a<Btn1Up>:- ContainerEndExtend()
≈c ≈s ≈m ≈a<Btn2Down>:- ContainerStartTransfer(
Copy) c s ≈m ≈a<Btn2Down>:- ContainerStartTransfer(
Link) ≈c s ≈m ≈a<Btn2Down>:- ContainerStartTransfer(
Move) ≈m ≈a<Btn2Up>:- ContainerEndTransfer()
:c s a<Key><osfInsert>:- ContainerPrimaryLink()
:c s m<Key><osfInsert>:- ContainerPrimaryLink()
:a<Key><osfInsert>:- ContainerPrimaryCopy()
:m<Key><osfInsert>:- ContainerPrimaryCopy()
:s a<Key><osfDelete>:- ContainerPrimaryMove()
:s m<Key><osfDelete>:- ContainerPrimaryMove()
:<Key><osfCancel>:- ContainerCancel()
:s<Key><osfSelect>:- ContainerExtend()
:<Key><osfSelect>:- ContainerSelect()
:<Key><osfSelectAll>:- ContainerSelectAll()
:<Key><osfDeselectAll>:- ContainerDeselectAll()
:<Key><osfAddMode>:- ContainerToggleMode()
:<Key><osfActivate>:- ContainerActivate()
s ≈c ≈m ≈a<Key>space:- ContainerExtend()
≈s ≈c ≈m ≈a<Key>space:- ContainerSelect()
≈s ≈c ≈m ≈a<Key>Return:- ContainerActivate()
≈s c ≈m ≈a<Key>slash:- ContainerSelectAll()
≈s c ≈m ≈a<Key>backslash:- ContainerDeselectAll()
:c s<Key><osfBeginLine>:- ContainerExtendCursor(
First) :c s<Key><osfEndLine>:- ContainerExtendCursor(
Last) :c<Key><osfBeginLine>:- ContainerMoveCursor(
First) :c<Key><osfEndLine>:- ContainerMoveCursor(
Last) :c<Key><osfLeft>:- ContainerExpandOrCollapse(
Left) :c<Key><osfRight>:- ContainerExpandOrCollapse(
Right) :s<Key><osfUp>:- ContainerExtendCursor(
Up) :s<Key><osfDown>:- ContainerExtendCursor(
Down) :s<Key><osfLeft>:- ContainerExtendCursor(
Left) :s<Key><osfRight>:- ContainerExtendCursor(
Right) :<Key><osfUp>:- ContainerMoveCursor(
Up) :<Key><osfDown>:- ContainerMoveCursor(
Down) :<Key><osfLeft>:- ContainerMoveCursor(
Left) :<Key><osfRight>:- ContainerMoveCursor(
Right) s ≈m ≈a<Key>Tab:- ManagerGadgetPrevTabGroup()
≈s ≈m ≈a<Key>Tab:- ManagerGadgetNextTabGroup()
The Container button event translations are modified when Display’s XmNenableBtn1Transfer resource does not have a value of XmOFF (in other words, it is either XmBUTTON2_TRANSFER or XmBUTTON2_ADJUST). This option allows the actions for selection and transfer to be integrated on <Btn1>, and the actions for extending the selection can be bound to <Btn2>. The actions for <Btn1> that are defined in the preceding list still apply when the <Btn1> event occurs over text that is not selected. The following actions apply when the <Btn1> event occurs over text that is selected:
~c ~s ~m ~a<Btn1Down>:- ContainerHandleBtn1Down(
ContainerBeginSelect,Copy) c ~s ~m ~a <Btn1Down>:- ContainerHandleBtn1Down(
ContainerBeginToggle,Copy) c s ~m ~a <Btn1Down>:- ContainerHandleBtn1Down(
ContainerNoop,Link) ~c s ~m ~a <Btn1Down>:- ContainerHandleBtn1Down(
ContainerBeginExtend,Move) <Btn1Motion>:- ContainerHandleBtn1Motion(
ContainerButtonMotion) ~c ~s ~m ~a <Btn1Up>:- ContainerHandleBtn1Up(
ContainerEndSelect) c ~s ~m ~a <Btn1Up>:- ContainerHandleBtn1Up(
ContainerEndToggle) ~c s ~m ~a <Btn1Up>:- ContainerHandleBtn1Up(
ContainerEndExtend) c s ~m ~a <Btn1Down>:- ContainerHandleBtn1Down(
ContainerBeginExtend) c s ~m ~a <Btn1Up>:- ContainerHandleBtn1Up(
ContainerEndExtend)
When Display’s XmNenableBtn1Transfer resource has a value of XmBUTTON2_ADJUST, the following actions apply:
~c ~s ~m ~a <Btn2Down>:- ContainerHandleBtn2Down(
ContainerStartTransfer,Copy) c s ~m ~a <Btn2Down>:- ContainerHandleBtn2Down(
ContainerStartTransfer,Link) ~c s ~m ~a <Btn2Down>:- ContainerHandleBtn2Down(
ContainerStartTransfer,Move) <Btn2Motion>:- ContainerHandleBtn2Motion(
ContainerButtonMotion) ~m ~a <Btn2Up>:- ContainerHandleBtn2Up(
ContainerEndTransfer)
Action Routines
The Container action routines are described below. The current selections are always shown with the background color specified by the XmNselectColor resource.
- ContainerActivate():
- This action calls
XmNdefaultActionCallbackwith reasonXmCR_DEFAULT_ACTION. - ContainerBeginExtend():
- Simply returns if
XmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. Simply returns ifXmNlayoutTypeisXmSPATIAL.- Otherwise, this action sets the selection state of all items between the anchor item and the item under the pointer to the selection state of the anchor item. The location cursor is moved to the item under the pointer. If
XmNautomaticSelectionisXmAUTO_SELECT, theXmNselectionCallback(s) is called with eitherXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTas the reason depending onXmNselectionPolicy, and withauto_selection_typeXmAUTO_CHANGE. - Otherwise, this action sets the selection state of all items between the anchor item and the item under the pointer to the selection state of the anchor item. The location cursor is moved to the item under the pointer. If
- ContainerBeginSelect():
- If this is a second ContainerBeginSelect() action that has occurred within the time specified by the display’s multiclick time, this action calls
XmNdefaultActionCallbackwith reasonXmCR_DEFAULT_ACTIONand returns.- Otherwise, processing depends on the value of
XmNselectionPolicyas follows:-
XmSINGLE_SELECT- This action deselects all items and toggles the item (if any) under the pointer.
XmBROWSE_SELECT- This action deselects all items and toggles the item (if any) under the pointer. This item is now the anchor item for further selection. If
XmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made, theXmNselectionCallback(s) is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_BEGIN. XmMULTIPLE_SELECT- If the pointer is over an item and
XmNselectionTechniqueis notXmMARQUEE, this action toggles the selection state of that item. The item becomes the anchor item for further selection. IfXmNselectionTechniqueisXmMARQUEE,XmMARQUEE_EXTEND_START, orXmMARQUEE_EXTEND_BOTH, this action sets the start point for the Marquee rectangle. IfXmNselectionTechniqueisXmMARQUEE_EXTEND_STARTorXmMARQUEE_EXTEND_BOTHand the pointer is over an item, this action draws the Marquee rectangle around the item. IfXmNautomaticSelectionisXmAUTO_SELECT, theXmNselectionCallback(s) is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_BEGIN. XmEXTENDED_SELECT- All items are first deselected. Processing is then identical to the case where
XmNselectionPolicyisXmMULTIPLE_SELECT, except thatXmCR_EXTENDED_SELECTis the callback reason given ifXmNselectionCallbackis called.
- Otherwise, processing depends on the value of
- ContainerBeginToggle():
- Simply returns if
XmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT.- Otherwise, if the pointer is over an item and
XmNselectionTechniqueis notXmMARQUEE, this action toggles the selection state of that item. The item becomes the anchor item for further selection. IfXmNselectionTechniqueisXmMARQUEE,XmMARQUEE_EXTEND_START, orXmMARQUEE_EXTEND_BOTHthis action sets the start point for the Marquee rectangle. IfXmNselectionTechniqueisXmMARQUEE_EXTEND_STARTorXmMARQUEE_EXTEND_BOTHand the pointer is over an item, this action draws the Marquee rectangle around the item. IfXmNautomaticSelectionisXmAUTO_SELECT, theXmNselectionCallback(s) is called with eitherXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTas the reason, depending onXmNselectionPolicy, and withauto_selection_typeXmAUTO_BEGIN. - Otherwise, if the pointer is over an item and
- ContainerButtonMotion():
- Processing depends on the value of
XmNselectionPolicy, as follows:-
XmSINGLE_SELECT- This action simply returns to the caller.
XmBROWSE_SELECT- Simply returns if this action follows a ContainerBeginExtend() action or ContainerBeginToggle() action.
- If the pointer is no longer over the current anchor item, this action toggles the current anchor item and then toggles the item under the pointer (if any) and makes it the new anchor item for further processing. If
XmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made, theXmNselectionCallback(s) is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_MOTION. - If the pointer is no longer over the current anchor item, this action toggles the current anchor item and then toggles the item under the pointer (if any) and makes it the new anchor item for further processing. If
XmMULTIPLE_SELECT- If a previous action has set a Marquee rectangle start point, this action draws the Marquee rectangle between the current pointer position and the Marquee start point. If the
XmNselectionTechniqueisXmMARQUEE_EXTEND_BOTHand the pointer is over an item, the end point of the Marquee rectangle is extended to include the item. The selection states of all items within the Marquee rectangle are toggled to match the state of the anchor item.- If no Marquee rectangle start point is set and the pointer is over an item, processing depends on the
XmNlayoutTyperesource. The anchor item from the previous action is used. IfXmNlayoutTypeisXmSPATIAL, the selection state of the item under the pointer is toggled to match the selection state of the anchor item. IfXmNlayoutTypeisXmOUTLINEorXmDETAIL, the selection state of all items between the anchor item and the item under the pointer are toggled to match the selection state of the anchor item.- If
XmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made, theXmNselectionCallback(s) is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_MOTION. - If no Marquee rectangle start point is set and the pointer is over an item, processing depends on the
XmEXTENDED_SELECT- Processing is identical to the case where
XmNselectionPolicyisXmMULTIPLE_SELECT, except thatXmCR_EXTENDED_SELECTis the callback reason given ifXmNselectionCallbackis called.
-
- ContainerCancel():
- If a selection is in progress, this action restores selection states of all items to their state before the selection began. If
XmNautomaticSelectionis True and a change in any item’s selection state is made, theXmNselectionCallbackis called with reasonXmCR_BROWSE_SELECT,XmMULTIPLE_SELECT, orXmCR_EXTENDED_SELECTdepending on theXmNselectionPolicyresource andauto_selection_typeXmAUTO_CANCEL. - ContainerDeselectAll():
- This action deselects all items and calls
XmNselectionCallbackwith reason depending onXmNselectionPolicy. - ContainerEndExtend():
- Simply returns if
XmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. Simply returns ifXmNlayoutTypeisXmSPATIAL.- Otherwise, if
XmNautomaticSelectionisXmNO_AUTO_SELECT,XmNselectionCallback(s) is called with eitherXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTas the reason depending onXmNselectionPolicy. IfXmNautomaticSelectionisXmAUTO_SELECTand no change is made in any item’s selection state by this action,XmNselectionCallback(s) is called with eitherXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTas the reason depending onXmNselectionPolicyandauto_selection_typeXmAUTO_CHANGE. IfXmNautomaticSelectionisXmAUTO_SELECTand this action makes no change in any item’s selection state,XmNselectionCallback(s) is called with eitherXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTas the reason depending onXmNselectionPolicyandauto_selection_typeXmAUTO_NO_CHANGE. - Otherwise, if
- ContainerEndSelect():
- Processing depends on the value of
XmNselectionPolicy, as follows:-
XmSINGLE_SELECT- This action calls
XmNselectionCallbackwith reasonXmCR_SINGLE_SELECT. XmBROWSE_SELECT- If the pointer is no longer over the current anchor item, this action toggles the current anchor item and then toggles the item under the pointer (if any). If
XmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s) is called with reasonXmCR_BROWSE_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made,XmNselectionCallback(s) is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_CHANGE. IfXmNautomaticSelectionisXmAUTO_SELECTand no change is made in any item’s selection state by this action,XmNselectionCallback(s) is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_NO_CHANGE. XmMULTIPLE_SELECT- This action first performs the same processing as the ContainerButtonMotion() action, except that
XmNselectionCallbackis not called. IfXmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s) is called with reasonXmCR_MULTIPLE_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made, theXmNselectionCallback(s) is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_CHANGE. IfXmNautomaticSelectionisXmAUTO_SELECTand this action makes no change in any item’s selection state,XmNselectionCallback(s) is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_NO_CHANGE. XmEXTENDED_SELECT- This action first performs the same processing as the ContainerButtonMotion() action, except that
XmNselectionCallbackis not called. IfXmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s) is called with reasonXmCR_EXTENDED_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item’s selection state is made,XmNselectionCallback(s) is called with reasonXmCR_EXTENDED_SELECTandauto_selection_typeXmAUTO_CHANGE. IfXmNautomaticSelectionisXmAUTO_SELECTand this action makes no change in any item’s selection state,XmNselectionCallback(s) is called with reasonXmCR_EXTENDED_SELECTandauto_selection_typeXmAUTO_NO_CHANGE.
-
- ContainerEndToggle():
- Simply returns if
XmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. IfXmNselectionPolicyisXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action performs the same processing as the ContainerEndSelect() action. - ContainerEndTransfer()::
- If the elapsed time since a ContainerStartTransfer() action has occurred exceeds the time span specified by the display’s multiclick time, this action returns.
- Otherwise, the ContainerPrimaryCopy(), ContainerPrimaryLink(), or ContainerPrimaryMove() action is invoked, depending on the value of the operation parameter saved by ContainerStartTransfer().
- ContainerExpandOrCollapse(
Left|Right|Collapse|Expand): - This action changes the value of the
XmNoutlineStateof the current focus widget. If the argument value isCollapseorLeft, theXmNoutlineStateresource value is set toXmCOLLAPSED. If the argument value isExpandorRight, theXmNoutlineStateresource value is set toXmEXPANDED.- If the argument is
LeftorRightand the layout is right to left, then the setting of theXmNoutlineStatevalue is reversed from that described in the preceding paragraph.- Simply returns if
XmNlayoutTypeisXmSPATIAL. - If the argument is
- ContainerExtend():
- Processing depends on the value of
XmNselectionPolicy, as follows:- If the selection policy is
XmSINGLE_SELECTorXmBROWSE_SELECT, this action returns. IfXmNlayoutTypeisXmSPATIAL, this action returns.- If the selection policy is
XmMULTIPLE_SELECT, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item.- If the selection policy is
XmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor. If the selection policy isXmEXTENDED_SELECTand the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item.XmNselectionCallbackis called with reasonXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTdepending onXmNselectionPolicy. - If the selection policy is
- ContainerExtendCursor(
Left|Right|Up|Down): - Processing depends on the value of
XmNselectionPolicy, as follows:- If the selection policy is
XmSINGLE_SELECTorXmBROWSE_SELECT, this action returns. IfXmNlayoutTypeisXmSPATIAL, this action returns.- This action moves the location cursor one item in the indicated direction, if possible. If the value of the argument string is
FirstorLast, this action moves the location cursor to the indicated item. For other values of the argument string, the location cursor is not affected.- If the selection policy is
XmMULTIPLE_SELECT, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item.- If the selection policy is
XmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor. If the selection policy isXmEXTENDED_SELECTand the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item.XmNselectionCallbackis called with reasonXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTdepending onXmNselectionPolicy. - If the selection policy is
- ContainerHandleBtn1Down(string
) - When Display’s
XmNenableBtn1Transferresource is notXmOFF, the actions for selection and transfer are integrated on<Btn1>. If the pointer is over an unselected item or background, the item is first selected before the transfer is started. Otherwise, if the item is already selected, the transfer is started. The value of string can be one of the following actions:-
- •
ContainerBeginSelect,Copy- •
ContainerBeginToggle,Copy- •
ContainerNoop,Link- •
ContainerBeginExtend,Move
-
- ContainerHandleBtn1Motion(string
) - When Display’s
XmNenableBtn1Transferresource is notXmOFF, the actions for selection and transfer are integrated on<Btn1>. When this action is invoked, and a selection is in progress, a drag is performed. Otherwise, the default action as specified in string is performed. The value of string can beContainerButtonMotion. - ContainerHandleBtn1Up(string
) - If a Button 1 transfer was in progress, then when this action is invoked, that transfer is cancelled. Otherwise, the default action as specified in string is performed. The value of string can be one of the following actions:
-
- •
ContainerEndSelect- •
ContainerEndToggle- •
ContainerEndExtend
-
- ContainerHandleBtn2Down(string
) - When Display’s
XmNenableBtn1Transferresource has a value ofXmBUTTON2_ADJUST, the actions for extending selection are bound on<Btn2>. Otherwise, the action that is performed depends on the value of string, which can be one of the following actions:-
- •
ContainerStartTransfer,Copy- •
ContainerStartTransfer,Link- •
ContainerStartTransfer,Move
-
- ContainerHandleBtn2Motion(string
) - When Display’s
XmNenableBtn1Transferresource is notXmBUTTON2_ADJUST, and a selection is in progress, a drag is performed. Otherwise, the default action that is performed depends on the value of string, which can beContainerButtonMotion. - ContainerHandleBtn2Up(string
) - When Display’s
XmNenableBtn1Transferresource has a value ofXmBUTTON2_ADJUST, this action ends an extend. Otherwise, the action that is performed depends on the value of string, which can beContainerEndTransfer. - ContainerMoveCursor(
Left|Right|Up|Down|First|Last): - If the argument is
Left,Right,Up, orDown, this action moves the location cursor one item in the indicated direction, if possible. If the value of the argument string isFirstorLast, this action moves the location cursor to the indicated item. Any other arguments are ignored.- If
XmNselectionPolicyisXmBROWSE_SELECT, or ifXmNselectionPolicyisXmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items, selects the item at the location cursor, and callsXmNselectionCallbackwith the reason depending onXmNselectionPolicy. - If
- ContainerPrimaryCopy():
- This action requests that primary selection data be copied to the Container. This action calls the
XmNdestinationCallbackprocedures for thePRIMARYselection and theXmCOPYoperation. By default, the Container does not do any transfer, and copying the selection is the responsibility of theXmNdestinationCallbackprocedures. - ContainerPrimaryLink():
- This action requests that primary selection data be linked to the Container. This action calls the
XmNdestinationCallbackprocedures for thePRIMARYselection and theXmLINKoperation. By default, the Container does not do any transfer, and linking the selection is the responsibility of theXmNdestinationCallbackprocedures. - ContainerPrimaryMove():
- This action requests that primary selection data be copied to the Container and deleted from the primary source. This action calls the
XmNdestinationCallbackprocedures for thePRIMARYselection and theXmMOVEoperation. By default, the Container does not do any transfer, and moving the selection is the responsibility of theXmNdestinationCallbackprocedures. If the transfer is successful, this action then calls the selection owner’sXmNconvertCallbackprocedures for thePRIMARYselection and theDELETEtarget. - ContainerSelect():
- Processing depends on the value of
XmNselectionPolicy, as follows:- If the selection policy is
XmSINGLE_SELECTorXmBROWSE_SELECT, this action deselects all items and selects the item at the location cursor.- If the selection policy is
XmMULTIPLE_SELECT, this action toggles the selection state of the item at the location cursor. This item becomes the anchor item for further selections.- If the selection policy is
XmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items and selects the item at the location cursor. If the selection policy isXmEXTENDED_SELECTand the Container is in Add Mode, this action toggles the selection state of the item at the location cursor. The selected/toggled item becomes the anchor item for further selections.XmNselectionCallbackis called with the reason depending onXmNselectionPolicy. - If the selection policy is
- ContainerSelectAll():
- If
XmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT, this action deselects all items and selects the item at the location cursor position.- If
XmNselectionPolicyisXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action selects all items.XmNselectionCallbackis called with the reason depending on the value ofXmNselectionCallback. - If
- ContainerStartTransfer(
Copy|Move|Link): - This action saves the event and the operation specified in the argument string for use by subsequent actions. If no ContainerEndTransfer() actions occur within the time span specified by the display’s multiclick time and if
XmNlayoutTypeisXmSPATIAL, this action creates a DragContext and starts a drag transfer by using string to specify the transfer operation. If no argument string is specified,Copyis the default value.- Unless default drag and drop behavior has been overridden by a
XmNconvertCallbackprocedure, if the drop operation occurs within the Container, then the item(s) being dragged are relocated at the position of the drop operation. If the item targeted by the Drag operation is not in the selected state, then only that item is moved. If the item is in the selected state, however, all items in the selected state are moved. - Unless default drag and drop behavior has been overridden by a
- ContainerToggleMode():
- If
XmNselectionPolicyisXmEXTENDED_SELECT, this action toggles the Container between Normal Mode and Add Mode.
Additional Behavior
The Container widget has the following additional behavior:
<Btn1Down>(2+)- If a button click is followed by another button click within the time span specified by the display’s multiclick time, the Container interprets that as a double-click and calls the
XmNdefaultActionCallbackcallbacks. <FocusIn>:- If the focus policy is explicit, sets the focus and draws the location cursor.
<FocusOut>:- If the focus policy is explicit, removes the focus and erases the location cursor.
Virtual Bindings
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
Related
Composite(3), Constraint(3), Core(3), XmContainerCopy, XmContainerCopyLink, XmContainerCut, XmContainerGetItemChildren, XmContainerPaste, XmContainerPasteLink, XmContainerRelayout(3), XmContainerReorder(3), XmCreateContainer(3), XmCreateIconGadget(3), XmIconGadget(3), XmManager(3), XmVaCreateContainer(3), and XmVaCreateManagedContainer(3).
