SelectMenuItem

Category: Objects / Menu
Since engine version: 4.9.1.0 GWE

Description

Sets menu selection in an object menu.

Syntax

bool SelectMenuItem (int iItem, object pMenuObj);

Parameters

iItem:
Number of the menu item which is to be selected. The first entry is number 0.
pMenuObj:
[opt] Menu object for which to change menu selection. Can be 0 if the menu is open for the calling object.

Example

SelectMenuItem can be used in conjunction with GetMenuSelection to update menu entries without losing menu item selection:
var iSelection = -1;
// Menu bereits geöffnet?
if(GetMenu())
  iSelection = GetMenuSelection();

// [ Hier Menu (neu) erstellen... ]

// Selektion wiederherstellen?
if(iSelection >= 0)
  SelectMenuItem(iSelection);
See also: AddMenuItem, CreateMenu, GetMenu, GetMenuSelection
PeterW, Oktober 2002