Content-type: text/html
XmCascadeButton - The CascadeButton widget class
#include <Xm/CascadeB.h>
CascadeButton links two MenuPanes or a MenuBar to a MenuPane.
It is used in menu systems and must have a RowColumn parent with its XmNrowColumnType resource set to XmMENU_BAR, XmMENU_POPUP or XmMENU_PULLDOWN.
It is the only widget that can have a Pulldown MenuPane attached to it as a submenu. The submenu is displayed when this widget is activated within a MenuBar, a PopupMenu, or a PulldownMenu. Its visuals can include a label or pixmap and a cascading indicator when it is in a Popup or Pulldown MenuPane; or, it can include only a label or a pixmap when it is in a MenuBar.
The default behavior associated with a CascadeButton depends on the type of menu system in which it resides. By default, BSelect controls the behavior of the CascadeButton. In addition, BMenu controls the behavior of the CascadeButton if it resides in a PopupMenu system. The actual mouse button used is determined by its RowColumn parent.
A CascadeButton's visuals differ from most other button gadgets. When the button becomes armed, its visuals change from a 2-D to a 3-D look, and it displays the submenu that has been attached to it. If no submenu is attached, it simply changes its visuals.
When a CascadeButton within a Pulldown or Popup MenuPane is armed as the result of the user moving the mouse pointer into the widget, it does not immediately display its submenu. Instead, it waits a short amount of time to see if the arming was temporary (that is, the user was simply passing through the widget), or whether the user really wanted the submenu posted. This time delay is configurable via XmNmappingDelay.
CascadeButton provides a single mechanism for activating the widget from the keyboard. This mechanism is referred to as a keyboard mnemonic. If a mnemonic has been specified for the widget, the user may activate the CascadeButton by simply typing the mnemonic while the CascadeButton is visible. If the CascadeButton is in a MenuBar and the MenuBar does not have the focus, the MAlt modifier must be pressed with the mnemonic. Mnemonics are typically used to interact with a menu via the keyboard interface.
If in a Pulldown or Popup MenuPane and there is a submenu attached,
the XmNmarginBottom, XmNmarginLeft, XmNmarginRight, and XmNmarginTop resources may enlarge to accommodate XmNcascadePixmap. XmNmarginWidth defaults to 6 if this resource is in a MenuBar; otherwise, it
takes Label's default, which is 2.
CascadeButton inherits behavior and resources from Core, XmPrimitive, and XmLabel classes.
The class pointer is xmCascadeButtonWidgetClass.
The class name is XmCascadeButton.
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 if 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).
XmCascadeButton Resource Set
Class: XmCCallback Default: NULL Type: XtCallbackList Access: C Class: XmCPixmap Default: dynamic Type: Pixmap Access: CSG Class: XmCCallback Default: NULL Type: XtCallbackList Access: C Class: XmCMappingDelay Default: 180 ms Type: int Access: CSG Class: XmCMenuWidget Default: NULL Type: Widget Access: CSG
CascadeButton inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass.
XmLabel Resource Set
Class: XmCAccelerator Default: NULL Type: String Access: N/A Class: XmCAcceleratorText Default: NULL Type: XmString Access: N/A Class: XmCAlignment Default: dynamic Type: unsigned char Access: CSG Class: XmCFontList Default: dynamic Type: XmFontList Access: CSG Class: XmCLabelInsensitivePixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG Class: XmCLabelPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG Class: XmCXmString Default: dynamic Type: XmString Access: CSG Class: XmCLabelType Default: XmSTRING Type: unsigned char Access: CSG Class: XmCMarginBottom Default: dynamic Type: Dimension Access: CSG Class: XmCMarginHeight Default: 2 Type: Dimension Access: CSG Class: XmCMarginLeft Default: 0 Type: Dimension Access: CSG Class: XmCMarginRight Default: dynamic Type: Dimension Access: CSG Class: XmCMarginTop Default: dynamic Type: Dimension Access: CSG Class: XmCMarginWidth Default: dynamic Type: Dimension Access: CSG Class: XmCMnemonic Default: NULL Type: KeySym Access: CSG Class: XmCMnemonicCharSet Default: XmFONTLIST_DEFAULT_TAG Type: String Access: CSG Class: XmCRecomputeSize Default: True Type: Boolean Access: CSG Class: XmCStringDirection Default: dynamic Type: XmStringDirection Access: CSG
XmPrimitive Resource Set
Class: XmCBottomShadowColor Default: dynamic Type: Pixel Access: CSG Class: XmCBottomShadowPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG Class: XmCForeground Default: dynamic Type: Pixel Access: CSG Class: XmCCallback Default: NULL Type: XtCallbackList Access: C Class: XmCHighlightColor Default: dynamic Type: Pixel Access: CSG Class: XmCHighlightOnEnter Default: False Type: Boolean Access: CSG Class: XmCHighlightPixmap Default: dynamic Type: Pixmap Access: CSG Class: XmCHighlightThickness Default: 0 Type: Dimension Access: CSG Class: XmCNavigationType Default: XmNONE Type: XmNavigationType Access: CSG Class: XmCShadowThickness Default: 2 Type: Dimension Access: CSG Class: XmCTopShadowColor Default: dynamic Type: Pixel Access: CSG Class: XmCTopShadowPixmap Default: dynamic Type: Pixmap Access: CSG Class: XmCTraversalOn Default: dynamic Type: Boolean Access: G Class: XmCUnitType Default: dynamic Type: unsigned char Access: CSG Class: XmCUserData Default: NULL Type: XtPointer Access: CSG
Core Resource Set
Class: XmCAccelerators Default: dynamic Type: XtAccelerators Access: CSG Class: XmCSensitive Default: dynamic Type: Boolean Access: G Class: XmCBackground Default: dynamic Type: Pixel Access: CSG Class: XmCPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG Class: XmCBorderColor Default: XtDefaultForeground Type: Pixel Access: CSG Class: XmCPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG Class: XmCBorderWidth Default: 0 Type: Dimension Access: CSG Class: XmCColormap Default: dynamic Type: Colormap Access: CG Class: XmCDepth Default: dynamic Type: int Access: CG Class: XmCCallback Default: NULL Type: XtCallbackList Access: C Class: XmCHeight Default: dynamic Type: Dimension Access: CSG Class: XmCInitialResourcesPersistent Default: True Type: Boolean Access: C Class: XmCMappedWhenManaged Default: True Type: Boolean Access: CSG Class: XmCScreen Default: dynamic Type: Screen * Access: CG Class: XmCSensitive Default: True Type: Boolean Access: CSG Class: XmCTranslations Default: dynamic Type: XtTranslations Access: CSG Class: XmCWidth Default: dynamic Type: Dimension Access: CSG Class: XmCPosition Default: 0 Type: Position Access: CSG Class: XmCPosition Default: 0 Type: Position Access: CSG
A pointer to the following structure is passed to each callback:
typedef struct
{
int reason;
XEvent * event;
} XmAnyCallbackStruct;
Indicates why the callback was invoked.
Points to the XEvent that triggered the
callback or is NULL if this callback was not triggered due to an XEvent.
XmCascadeButton includes translations from Primitive. XmCascadeButton includes the menu traversal translations from XmLabel. These translations may not directly correspond to a translation table.
Note that altering translations in #override or #augment mode is undefined.
The translations for a CascadeButton in a MenuBar are listed below. These translations may not directly correspond to a translation table. BSelect Press: MenuBarSelect() BSelect Release:DoSelect() KActivate: KeySelect() KSelect: KeySelect() KHelp: Help() MAny KCancel: CleanupMenuBar()
The translations for a CascadeButton in a PullDown or Popup MenuPane are listed below. In a Popup menu system, BMenu also performs the BSelect actions. These translations may not directly correspond to a translation table. BSelect Press: StartDrag() BSelect Release:DoSelect() KActivate: KeySelect() KSelect: KeySelect() KHelp: Help() MAny KCancel: CleanupMenuBar()
The XmCascadeButton action routines are described below: In a MenuBar, disarms the CascadeButton and the menu and, when the shell's keyboard focus policy is XmEXPLICT, restores keyboard focus to the widget that had the focus before the menu was entered.
Posting a submenu calls the XmNcascadingCallback callbacks. This widget has the additional behavior described below: If keyboard traversal is enabled does nothing. Otherwise, in a MenuBar that is armed, unposts any MenuPanes associated with another MenuBar entry, arms the CascadeButton, and posts the associated submenu. In other menus, arms the CascadeButton and posts the associated submenu after the delay specified by XmNmappingDelay. If keyboard traversal is enabled does nothing. Otherwise, in a MenuBar that is armed, disarms the CascadeButton if the submenu associated with the CascadeButton is not currently posted or if there is no submenu associated with the CascadeButton.
The bindings for virtual keys are vendor specific. For information about
bindings for virtual buttons and keys, see
VirtualBindings(3X).
Core(3X), XmCascadeButtonHighlight(3X), XmCreateCascadeButton(3X), XmCreateMenuBar(3X), XmCreatePulldownMenu(3X), XmCreatePopupMenu(3X), XmLabel(3X), XmPrimitive(3X), XmRowColumn(3X)