The popup menu item creates a floating pulldown menu under the mouse cursor when opened. The item can be opened the item hook function during button event processing. This item is simply a reference to an existing pulldown menu resource which can be used as a popup menu by the application program.
An application program causes a popup menu to be displayed by using a dialog box hook function that handles the DIALOG_MESSAGE_BUTTON event for a dialog box containing a popup menu item in its item list. The hook function can cause a popup menu to be opened by setting the dmP->u.button.buttonRiP field to point to the raw item header of the popup menu item. This causes the popup menu to be displayed under the mouse cursor and the user to select a entry in that popup menu. Typically, the popup menu is opened on a BUTTONTRANS_DOWN event with some form of modifier key (SHIFT, CTRL or ALT key combined with the mouse down event).
The DialogItemRsc field extent to is ignored by the item handler and should be set to 0 in all subfields.
The type field should be PopupMenu.
The ID determines the DItem_PopupMenuRsc instance to load.
The attributes field should always be HIDDEN.
The itemArg field is unused and should usually be set to 0.
The label field is unused for popup menu items and should be set to "".
The auxInfo field is unused for popup menu items and should be set to "".
The following is an example of a popup menu item list specification:
The popup menut item is defined in a resource file with the following structure:
The DItem_PopupMenuRsc structure has the following unique fields. See CommonItemResourceFields.
|menuType||Specifies the type of pulldown menu resource to be used as a popup menu. This value must be one of PulldownMenu, RPulldownOptionMenu or PulldownCPickerMenu.|
|menuId||Specifies the resource id of the pulldown menu resource to be used as a popup menu.|
The following is an example of a popup menu item resource. This item is used in MicroStation's window environment, and is defined in MicroStation's resource file.
The following messages are sent to item hook functions that are attached to popup menu items:
DITEM_MESSAGE_CREATE DITEM_MESSAGE_INIT DITEM_MESSAGE_DESTROY
There are no popup menu item functions.