CreateMenu

Category: Objects / Menu
Since engine version: 1.0 OC

Description

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

Syntax

bool CreateMenu(id symbol, object command_object, int extra, string caption, int extra_data, int style, bool permanent, id menu_id);

Parameters

symbol:
The picture of this object definition is used as symbol.
command_object:
Object to receive the menu command (see AddMenuItem). Can be nil in local calls.
extra:
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_Value 2 Value
C4MN_Extra_Info 4 Display object description immediately.
caption:
Text to be displayed if the menu is empty.
extra_data:
Comparison value for extra 3.
style:
Appearance of the menu. The following constants are defined:
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.
permanent:
The menu stays open after an entry has been selected.
menu_id:
[opt] If specified, this id is used as menu id. The current menu id is returned by GetMenu

Example

See also: AddMenuItem, CloseMenu, GetMenu, SelectMenuItem
springer, 2002-04
Sven2, 2007-03