CreateMenu

Category: Objects / Menu
Since engine version: 4.6.5.0 CP

Description

Creates a user defined menu for the specified object. Menu entries are to be added using AddMenuItem.

Syntax

int CreateMenu (id idSymbol, object pMenuObject, object pCommandObject, int iExtra, string szCaption, int iExtraData, int iStyle, bool fPermanent, id idMenuID);

Parameters

idSymbol:
The picture of this object definition is used as symbol
pMenuObject:
Object in which to open the menu. Can be 0 in local calls
pCommandObject:
Object to receive the menu command (see AddMenuItem). Can be 0 in local calls
iExtra:
Additional information to be displayed about the currently selected entry. C4MN_ values are now also defined as constants:
Constant Value Effect
C4MN_Extra_None 0 Nothing
C4MN_Extra_Components 1 Components
C4MN_Extra_Value 2 Value
C4MN_Extra_MagicValue 3 Value as magic value. iExtraData is also displayed for comparison, e.g. "50/100".
C4MN_Extra_Info 4 Display object description immediately
C4MN_Extra_ComponentsMagic 5 Display components and magic value
C4MN_Extra_LiveMagicValue 6 Same as C4MN_Extra_MagicValue but the value is updated continuously.
C4MN_Extra_ComponentsLiveMagic 7 Same as C4MN_Extra_ComponentsMagic but the value is updated continuously.
szCaption:
Text to be displayed if the menu is empty
iExtraData:
Comparison value for iExtra 3
iStyle:
Appearance of the menu. The following constants are defined (from CR):
Constant Value Appearance
C4MN_Style_Normal 0 Normal
C4MN_Style_Context 1 Context menu
C4MN_Style_Info 2 Info menu
C4MN_Style_Dialog 3 Dialog
C4MN_Style_EqualItemHeight 128 Can be combined with C4MN_Style_Dialog: all entries with an icon are drawn with the same height.
fPermanent:
The menu stays open after an entry has been selected.
idMenuID:
[opt] If specified, this id is used as menu id. The current menu id is returned by GetMenu.

Example

see AddMenuItem
See also: AddMenuItem, CloseMenu, GetMenu, SelectMenuItem, SetMenuDecoration, SetMenuTextProgress
springer, April 2002
Sven2, März 2007