popupmenu Parameter

Sets the contents of the pop-up menu and associated pull-down menu items in the Editor window.

Note: This parameter is only valid when issued in an Editor window.

Scope: File

Syntax

set popupmenu.{Item|BITMAP_resdll_id}[.{Subitem|BITMAP_resdll_id}]
              [...] [OrdinalNumber] [Command] 
query popupmenu.{Item|BITMAP_resdll_id}[.{Subitem|BITMAP_resdll_id }][...] 

Options

Item 
Name of the menu item to be included on the pop-up menu.
Subitem 
Name of the selection item to be added to the Item pull-down menu.
BITMAP 
Specifies that the pop-up or pull-down menu item is a bitmap. If this is chosen, you must also specify:
resdll 
The resource dll containing the new item's bitmap.
id 
The id for the bitmap contained in the resdll resource dll.
OrdinalNumber 
The position at which the menu item is inserted, starting at zero. Separators are included in the count.
Command 
The action or actions to perform when Subitem is selected.

Description

The popupmenu parameter is used to add menu choices to the Editor window pop-up menu and its associated pull-down menus. You can create completely new pull-down menu sets, or you can add to the contents of existing pull-down menus.

Use text or icons to represent menu choices.

If Item, Subitem, or BITMAP is not an existing item, it is created.

If Item, Subitem, or BITMAP is an existing item, the following happens:

If a command is specified, the previous command is replaced with the newly-specified command.

If an item contains a pull-down or cascaded menu, you cannot change the contents of that item to a command. Similarly, if an item contains a command, you cannot change the contents of that item to a pull-down or cascaded menu. You must first delete the item, then recreate it specifying the new menu item contents.

If no command is specified, the item and any commands or sub- menu items attached to it are deleted.

Examples

  1. To create a Example pop-up menu item, which creates a sound when selected, type:
    set popupmenu.Example alarm 
  2. To create a Example pop-up menu item with a sub-menu item called Sound, which creates a sound when selected, and mnemonics for both items, type:
    set popupmenu.E~xample.~Sound alarm 

    The mnemonic for Example is x, and the mnemonic for Sound is s.

    Note: You cannot define menu items with the same name within a given menu set. Though Examples 1 and 2 appear to set up menu-bar items with the same base name, the mnemonic differentiates them. You could continue to set up more menu-bar items with the same base name as long as a different mnemonic was used for each item.

  3. To add an accelerator to the Sound sub-menu item defined in the above example, type:
    set popupmenu.E~xample.~Sound\tAlt+S alarm 

    The accelerator for Sound is Alt+S.

  4. You can use a bitmap in place of a text label for your menu item or sub-menu item. Bitmaps must be defined in a DLL file located in a directory path included in your PATH environment variable. The following example uses the bitmap with resource id 2, found in the evfwrc21.dll file included with the Editor. To add this bitmap to the pop-up menu defined in Example 2, type:
    set popupmenu.E~xample.BITMAP_evfwrc21_2 alarm 

    You can also use a bitmap as a menu item in the pop-up menu.

  5. You can define sub-menu items to sub-menu items. For example, the following example adds a sub-menu item called Add to the pop-up menu defined in Example 2. Selecting the Add pop-up menu item raises a cascaded menu, with menu items that add one, two, or three lines to your document.
    set popupmenu.E~xample.~Add.One_line add 1 
    set popupmenu.E~xample.~Add.Two_lines add 2 
    set popupmenu.E~xample.~Add.Three_lines add 3 

API Return Code

-1 
The option specified for Item was not valid. Type the option exactly as it appears in the menu, including uppercase and lowercase letters.
-2 
The item, sub-menu item, or bitmap name contains invalid characters, or you tried to define a new menu item without specifying a command.

popupinit Parameter
popuplink Parameter
popupmenuid Parameter
popupmenulist Parameter