IN_AddMenuItem

All Editions image\bltlrgsq_shg.gif  Related Functions  image\bltlrgsq_shg.gif  Example

The IN_AddMenuItem function adds the defined command to the specified menu.

Syntax

int IN_AddMenuItem( menuID, commandID, menuItemType, pRelMenuItem, relPsn )

Parameters

Values

Meaning

SHORT menuID

Identifier of the menu to add an item to:

 

IN_MENU_MAIN (1) main Imagenation menu bar

IN_MENU_LAYERS_WINDOW (2)
Layers window menu

IN_MENU_DETAIL_WINDOW (3)
Detail window menu

IN_MENU_SYMBOL_PALETTE (4)
Symbols palette menu

SHORT commandID

Command IDs identifier of the command to insert

IN_MENUITEM_SEPARATOR (1)
insert a separator

SHORT menuItemType

IN_MENUITEM_MENU (4) insert a menu that will have items under it

IN_MENUITEM_SUBMENU (5) insert a submenu that will have items under it

IN_MENUITEM_ITEM (6) insert a menu item

CHARPTR pRelMenuItem

Command IDs

menu item relative to which the new item will be inserted. If the item is not on the first level, use periods to indicate the level. If relative to File, Open, for example, use 100.101, not just 101. See Remarks.

SHORT relPsn

IN_MENU_PSN_FIRST (1) place new item first in the menu

IN_MENU_PSN_LAST (2) place new item last in the menu

IN_MENU_PSN_PREV (3) place new item before the pRelMenuItem

IN_MENU_PSN_NEXT (4) place new item after the pRelMenuItem

Remarks

You cannot create a second main menu bar or attach a menu to a floating window other than those that are listed above. You must attach the new menu, menu item, or submenu to an existing menu bar or floating window menu.

You must use the ID number associated with a command because the values for pRelMenuItem are passed in as a text string and not as numeric constants. Tip: Building text strings from constants

Only commands available in your edition of Imagenation, or external commands, can be added.

Release information

Added to Imagenation for Windows in Release 4.50.

As of Release 5.1, also available in Imagenation for UNIX.

See also

Changing menu contents

Defining menu bars