XmCascadeButton(library call) XmCascadeButton(library call)
NAME [Toc] [Back]
XmCascadeButton - The CascadeButton widget class
SYNOPSIS [Toc] [Back]
#include <Xm/CascadeB.h>
DESCRIPTION [Toc] [Back]
CascadeButton links two menu panes or a MenuBar to a menu pane.
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 menu pane 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 menu pane; or it can include only a label
or a pixmap when it is in a MenuBar. The positioning of the
PulldownMenu with respect to the CascadeButton depends on the
XmNlayoutDirection resource of the MenuShell.
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.
BMenu also performs the BSelect actions in all types of menu systems.
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 menu pane 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 using
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 using the keyboard interface.
- 1 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
If the Cascadebutton is in a Pulldown or Popup menu pane 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 uses the XmQTmenuSystem and XmQTspecifyRenderTable
traits.
Classes [Toc] [Back]
CascadeButton inherits behavior, resources, and traits from Core,
XmPrimitive, and XmLabel classes.
The class pointer is xmCascadeButtonWidgetClass.
The class name is XmCascadeButton.
New Resources [Toc] [Back]
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 |
|Name Class Type Default Access |
|_____________________|_________________|________________|_________|________|
|XmNactivateCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|_________________|________________|_________|________|
|XmNcascadePixmap | XmCPixmap | Pixmap | dynamic | CSG |
|_____________________|_________________|________________|_________|________|
|XmNcascadingCallback | XmCCallback | XtCallbackList | NULL | C |
|_____________________|_________________|________________|_________|________|
|XmNmappingDelay | XmCMappingDelay | int | 180 ms | CSG |
|_____________________|_________________|________________|_________|________|
|XmNsubMenuId | XmCMenuWidget | Widget | NULL | CSG |
|_____________________|_________________|________________|_________|________|
|_____________________|_________________|________________|_________|________|
XmNactivateCallback [Toc] [Back]
Specifies the list of callbacks that is called when the user
activates the CascadeButton widget and there is no submenu
attached to pop up. The activation occurs when a mouse
button is released or when the mnemonic associated with the
- 2 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
widget is typed. The specific mouse button depends on
information in the RowColumn parent. The reason sent by the
callback is XmCR_ACTIVATE.
XmNcascadePixmap [Toc] [Back]
Specifies the cascade pixmap displayed on one end of the
widget when a CascadeButton is used within a Popup or
Pulldown menu pane and a submenu is attached. The Label
class resources XmNmarginBottom, XmNmarginLeft,
XmNmarginRight, and XmNmarginTop may be modified to ensure
that room is left for the cascade pixmap. The default
cascade pixmap is an arrow pointing to the side of the menu
where the submenu will appear. The positioning of the
cascade pixmap to either the left of right of the widget,
and the direction of the arrow, depend on the
XmNlayoutDirection resource of the MenuShell.
XmNcascadingCallback [Toc] [Back]
Specifies the list of callbacks that is called just prior to
the mapping of the submenu associated with CascadeButton.
The reason sent by the callback is XmCR_CASCADING.
XmNmappingDelay [Toc] [Back]
Specifies the amount of time, in milliseconds, between when
a CascadeButton becomes armed and when it maps its submenu.
This delay is used only when the widget is within a Popup or
Pulldown menu pane. The value must not be negative.
XmNsubMenuId [Toc] [Back]
Specifies the widget ID for the Pulldown menu pane to be
associated with this CascadeButton. The specified menu pane
is displayed when the CascadeButton becomes armed. The menu
pane must have been created with the appropriate parentage
depending on the type of menu used. See XmCreateMenuBar(3),
XmCreatePulldownMenu(3), and XmCreatePopupMenu(3) for more
information on the menu systems.
Inherited Resources [Toc] [Back]
CascadeButton 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.
- 3 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
_____________________________________________________________________________________________________________
| XmLabel Resource Set |
|Name Class Type Default Access |
|__________________________|___________________________|___________________|________________________|________|
|XmNaccelerator | XmCAccelerator | String | NULL | N/A |
|__________________________|___________________________|___________________|________________________|________|
|XmNacceleratorText | XmCAcceleratorText | XmString | NULL | N/A |
|__________________________|___________________________|___________________|________________________|________|
|XmNalignment | XmCAlignment | unsigned char | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNfontList | XmCFontList | XmFontList | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNlabelInsensitivePixmap | XmCLabelInsensitivePixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNlabelPixmap | XmCLabelPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNlabelString | XmCXmString | XmString | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNlabelType | XmCLabelType | unsigned char | XmSTRING | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginBottom | XmCMarginBottom | Dimension | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginHeight | XmCMarginHeight | Dimension | 2 | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginLeft | XmCMarginLeft | Dimension | 0 | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginRight | XmCMarginRight | Dimension | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginTop | XmCMarginTop | Dimension | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmarginWidth | XmCMarginWidth | Dimension | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmnemonic | XmCMnemonic | KeySym | NULL | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNmnemonicCharSet | XmCMnemonicCharSet | String | XmFONTLIST_DEFAULT_TAG | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNrecomputeSize | XmCRecomputeSize | Boolean | True | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNrenderTable | XmCRenderTable | XmRenderTable | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|XmNstringDirection | XmCStringDirection | XmStringDirection | dynamic | CSG |
|__________________________|___________________________|___________________|________________________|________|
|__________________________|___________________________|___________________|________________________|________|
- 4 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
____________________________________________________________________________________________________
| XmPrimitive Resource Set |
|Name Class Type Default Access |
|________________________|_______________________|__________________|______________________|________|
|XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNconvertCallback | XmCCallback | XtCallbackList | NULL | C |
|________________________|_______________________|__________________|______________________|________|
|XmNforeground | XmCForeground | Pixel | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
|________________________|_______________________|__________________|______________________|________|
|XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNhighlightOnEnter | XmCHighlightOnEnter | Boolean | False | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNhighlightThickness | XmCHighlightThickness | Dimension | 0 | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNlayoutDirection | XmCLayoutDirection | XmDirection | dynamic | CG |
|________________________|_______________________|__________________|______________________|________|
|XmNnavigationType | XmCNavigationType | XmNavigationType | XmNONE | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNpopupHandlerCallback | XmCCallback | XtCallbackList | NULL | C |
|________________________|_______________________|__________________|______________________|________|
|XmNshadowThickness | XmCShadowThickness | Dimension | 2 | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNtraversalOn | XmCTraversalOn | Boolean | dynamic | G |
|________________________|_______________________|__________________|______________________|________|
|XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
|________________________|_______________________|__________________|______________________|________|
|XmNuserData | XmCUserData | XtPointer | NULL | CSG |
|________________________|_______________________|__________________|______________________|________|
|________________________|_______________________|__________________|______________________|________|
- 5 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
________________________________________________________________________________________________________________
| Core Resource Set |
|Name Class Type Default Access |
|______________________________|_______________________________|________________|______________________|________|
|XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G |
|______________________________|_______________________________|________________|______________________|________|
|XmNbackground | XmCBackground | Pixel | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNcolormap | XmCColormap | Colormap | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNdepth | XmCDepth | int | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C |
|______________________________|_______________________________|________________|______________________|________|
|XmNheight | XmCHeight | Dimension | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C |
|______________________________|_______________________________|________________|______________________|________|
|XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNscreen | XmCScreen | Screen * | dynamic | CG |
|______________________________|_______________________________|________________|______________________|________|
|XmNsensitive | XmCSensitive | Boolean | True | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNwidth | XmCWidth | Dimension | dynamic | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNx | XmCPosition | Position | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|XmNy | XmCPosition | Position | 0 | CSG |
|______________________________|_______________________________|________________|______________________|________|
|______________________________|_______________________________|________________|______________________|________|
Callback Information [Toc] [Back]
A pointer to the following structure is passed to each callback:
typedef struct
{
int reason;
XEvent * event;
- 6 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
} XmAnyCallbackStruct;
reason Indicates why the callback was invoked
event Points to the XEvent that triggered the callback or is NULL
if this callback was not triggered due to an XEvent
Translations [Toc] [Back]
XmCascadeButton includes translations from XmPrimitive.
XmCascadeButton includes the menu traversal translations from XmLabel.
Note that altering translations in #override or #augment mode is
undefined.
The following list describes the translations for a CascadeButton in a
MenuBar. 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.
<EnterWindow>Normal:
MenuBarEnter()
<LeaveWindow>Normal:
MenuBarLeave()
<Btn2Down>:
ProcessDrag()
c<BtnDown>:
MenuButtonTakeFocusUp()
c<BtnUp>: MenuButtonTakeFocusUp()
~c<BtnDown>:
MenuBarSelect()
~c<BtnUp>:
DoSelect()
:<Key><osfSelect>:
KeySelect()
:<Key><osfActivate>:
KeySelect()
:<Key><osfHelp>:
Help()
- 7 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
:<Key><osfCancel>:
CleanupMenuBar()
~s<Key>Return:
KeySelect()
~s<Key>space:
KeySelect()
The following list describes the translations for a CascadeButton in a
PullDown or Popup MenuPane. In a Popup menu system, <Btn3> also
performs the <Btn1> actions.
<EnterWindow>:
DelayedArm()
<LeaveWindow>:
CheckDisarm()
<Btn2Down>:
ProcessDrag()
c<BtnDown>:
MenuButtonTakeFocus()
c<BtnUp>: MenuButtonTakeFocusUp()
~c<BtnDown>:
StartDrag()
~c<BtnUp>:
DoSelect()
:<Key><osfSelect>:
KeySelect()
:<Key><osfActivate>:
KeySelect()
:<Key><osfHelp>:
Help()
:<Key><osfCancel>:
CleanupMenuBar()
~s<Key>Return:
KeySelect()
~s<Key>space:
KeySelect()
- 8 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
Action Routines [Toc] [Back]
The XmCascadeButton action routines are
CleanupMenuBar():
In a MenuBar, disarms the CascadeButton and the menu and,
when the shell's keyboard focus policy is XmEXPLICIT,
restores keyboard focus to the widget that had the focus
before the menu was entered.
In a toplevel Pulldown MenuPane from a MenuBar, unposts the
menu, disarms the MenuBar CascadeButton and the MenuBar,
and, when the shell's keyboard focus policy is XmEXPLICIT,
restores keyboard focus to the widget that had the focus
before the MenuBar was entered. In other Pulldown
MenuPanes, unposts the menu.
In a Popup MenuPane, unposts the menu and, when the shell's
keyboard focus policy is XmEXPLICIT, restores keyboard focus
to the widget from which the menu was posted.
DoSelect():
Calls the callbacks in XmNcascadingCallback, posts the
submenu attached to the CascadeButton and enables keyboard
traversal within the menu. If the CascadeButton does not
have a submenu attached, this action calls the callbacks in
XmNactivateCallback, activates the CascadeButton, and
unposts all posted menus in the cascade.
Help(): Unposts all menus in the menu hierarchy and, when the
shell's keyboard focus policy is XmEXPLICIT, restores
keyboard focus to the widget that had the focus before the
menu system was entered. Calls the callbacks for
XmNhelpCallback if any exist. If there are no help
callbacks for this widget, this action calls the help
callbacks for the nearest ancestor that has them.
KeySelect():
Calls the callbacks in XmNcascadingCallback, and posts the
submenu attached to the CascadeButton if keyboard traversal
is enabled in the menu. If the CascadeButton does not have
a submenu attached, this action calls the callbacks in
XmNactivateCallback, activates the CascadeButton, and
unposts all posted menus in the cascade.
MenuBarSelect():
Unposts any menus posted by the parent menu. Arms both the
CascadeButton and the MenuBar, posts the associated submenu,
and enables mouse traversal. If the menu is already active,
this event disables keyboard traversal for the menu and
returns the menu to mouse traversal mode.
- 9 - Formatted: January 24, 2005
XmCascadeButton(library call) XmCascadeButton(library call)
StartDrag():
Arms the CascadeButton, posts the associated submenu, and
enables mouse traversal. If the menu is already active,
this event disables keyboard traversal for the menu and
returns the menu to mouse traversal mode.
Additional Behavior [Toc] [Back]
Posting a submenu calls the XmNcascadingCallback callbacks. This
widget has the following additional behavior:
<EnterWindow>:
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.
<LeaveWindow>:
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.
In other menus, if the pointer moves anywhere except into a
submenu associated with the CascadeButton, the CascadeButton
is disarmed and its submenu is unposted.
Virtual Bindings [Toc] [Back]
The bindings for virtual keys are vendor specific. For information
about bindings for virtual buttons and keys, see VirtualBindings(3).
RELATED [Toc] [Back]
Core(3), XmCascadeButtonHighlight(3), XmCreateCascadeButton(3),
XmCreateMenuBar(3), XmCreatePulldownMenu(3), XmCreatePopupMenu(3),
XmLabel(3), XmPrimitive(3), and XmRowColumn(3).
- 10 - Formatted: January 24, 2005 [ Back ] |