ABBREVIATED MENUBUTTON(3W) — OLIT
WIDGET CLASS NAME
AbbrevMenuButton
SYNOPSIS
#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <AbbrevMenu.h>
f4static Widget stack, menupane, w;
Arg args[1];
stack = XtCreateWidget(name, abbrevMenuButtonWidgetClass, ...);
XtSetArg(args[0], XtNmenuPane, &menupane);
XtGetValues(stack, args, 1);
w = XtCreateWidget(name, widget-class, menupane, ...);
DESCRIPTION
The AbbrevMenuButton widget provides the end user the same features as the MenuButton widget (menu default selection, menu previewing, menu selection), plus current selection viewing, and the ability to add a new selection by typing in its name. AbbrevMenuButton Components
Each abbreviated menu button has a submenu. An application typically identifies an additional component, the Current Selection Widget, where previewing of the default menu choice can be done. AbbrevMenuButton Sensitive Area
While on the Abbreviated Menu Button and the power-user option is on: – Pressing SELECT previews the default menu item (if a preview widget exists), and releasing it will activate the default menu item. – Clicking SELECT briefly previews the default menu item (if a preview widget exists) and then activates the default menu item. – Pressing MENU brings up a pop-up menu. – Clicking MENU produces a stayup menu.
If the power-user option is off: – Pressing SELECT or MENU brings up a pop-up menu. – Clicking SELECT or MENU produces a stayup menu. (The power-user option is set in the property sheet of the Window Manager. See the OPEN LOOK™ GUI User’s Guide for more information on setting this option.)
Figure 1 Abbreviated Menu Button
Each abbreviated menu button also has the components of a Menu widget. These are not shown in the diagram Abbreviated Menu Button. All Features of Menu Button Widget
The AbbrevMenuButton widget includes all the features of the MenuButton widget, except for the previewing (done instead in the Current Select Widget) and the behavior in a menu (the AbbrevMenuButton widget cannot be used in a menu). The features for the MeuButton widget apply here. Current Selection Widget
The Current Selection Widget is created by the application. Typically, the Current Selection Widget and the AbbrevMenuButton widget are placed together in a composite widget that manages their side-by-side placement. The AbbrevMenuButton widget uses the Current Selection Widget only for previewing the default item in the menu. The application is responsible for using it to implement the OPEN LOOK user interface needs of showing the current menu selection and acquiring a new item to add to the menu, as appropriate. AbbrevMenuButton Coloration
The diagram Abbreviated Menu Button Coloration illustrates the resources that affect the coloration of the AbbrevMenuButton widget.
Figure 2 Abbreviated Menu Button Coloration
SUBSTRUCTURE
Menu component
Name: menu
Class: Menu
Table 1 Abbreviated Menu Button Application Resources Abbreviated Menu Button Application Resources\\∗(cO
Name Type Default Access
∗XtNcenter Boolean TRUE I
∗XtNhPad Dimension 4 I
∗XtNhSpace Dimension 4 I
∗XtNmeasure int 1 I XtNpushpinDefault Boolean FALSE I
XtNtitle String (widget’s name) I
∗XtNvPad Dimension 4 I
∗XtNvSpace Dimension 4 I ∗ See the Menu and ControlArea widgets for more information on these resources.
RESOURCES
Table 2 AbbrevMenuButton Resource Set AbbrevMenuButton Resource Set\\∗(cO
Name Type Default Access XtNancestorSensitive Boolean TRUE G∗
XtNbackground Pixel White SGI†
XtNbackgroundPixmap Pixmap (none) SGI†
XtNdepth int (parent’s) GI
XtNdestroyCallback XtCallbackList NULL SI
XtNforeground Pixel Black SGI†
XtNheight Dimension (calculated) SGI XtNmappedWhenManaged Boolean TRUE SGI
XtNmenuPane Widget (none) G
XtNpreviewWidget Widget NULL SGI
XtNsensitive Boolean TRUE GI∗
XtNuserData XtPointer NULL SGI
XtNwidth Dimension (calculated) SGI
XtNx Position 0 SGI
XtNy Position 0 SGI XtNforeground
This resource defines the foreground color for the widget.
See the note about the interaction of this resource with other color resources under the description of the XtNbackground resource in CORE RESOURCES(3W). XtNmenuPane
This is the widget where menu items can be attached; its value is available once the AbbrevMenuButton widget has been created. XtNpreviewWidget
Range of Values:
(ID of existing widget)
This resource identifies the Current Selection Widget that the AbbrevMenuButton can use for previewing the Default Item.
When the end user presses SELECT over the AbbrevMenuButton widget, the AbbrevMenuButton widget uses the location and size of the Current Selection Widget to display the label of the Default Item. The preview is constrained to be within the height and width of the Current Selection Widget.
If the Current Selection Widget is not defined or is not mapped, previewing does not take place.
Sun Release 4.1 — Last change: 1/8/90