AddMenu - method of object PmMenu

Add one item to the menu.
AddMenu(sId As String, sText As String, [sOptions As String])
pEvent.Menu.AddMenu sId, sText, sOptions
sId(String) Identifier of the menu item.

This identifier can be used in onMenuSelect event to detect which menu item has been selected.

It is possible to enter an empty string ("") if this item is not being used in the onMenuSelect event (e.g. separator or text that is not used for selection).

The submenu items are referred to by compound identifier. The identifier consists of submenu identifier, separator (/) and item identifier. Items not included in the submenu have simple identifier without separator (full stop).

sText(String) Displaid text of the menu item. Macro expression can be used for input ($.text ..) (it is evaluated while calling a method).
sOptions[optional] (String) Additional parameters added items. Entries are in format KeyVal, for example "type:checkedtext;enabled:0;".
"type:sss;" (optional) - Specifies the type of added item.
type:text; (default) - The added item is text.
type:checkedtext; - The added item is text, marked as selected (checkbox on the left from the text).
type:separator; - The added item is a separator, i.e. a horizontal line is created. Parameter sText has no meaning.
type:menu; - The added item is a submenu, i.e. a text and submenu mark is created. The submenu has its identifier and the contained items also have identifiers. A compound identifier is created with full stop separator (/).
"enabled:n;" (optional) - Specifies whether the added item is allowed or disabled (1 = enabled (default), 0 = disabled).
This property is also functional for Web panels. So far not functional type:checktext;.
Script - The onMenuFill event: Creates the menu with 4 rows (START, STOP, PAUSE, Help) and submenu with 2 rows (Index, About).
JavaScriptVBScriptSelect and copy to clipboard

pEvent.Menu.AddMenu("start", "START");
pEvent.Menu.AddMenu("stop", "STOP");
pEvent.Menu.AddMenu("pause", "PAUSE");
pEvent.Menu.AddMenu("", "", "type:separator;");
pEvent.Menu.AddMenu("help", "Help", "type:menu;");
pEvent.Menu.AddMenu("help/index", "Index");
pEvent.Menu.AddMenu("help/about", "About");
Script - The onMenuSelect event: Execution of the appropriate action after the activation of the menu item by the user.
JavaScriptVBScriptSelect and copy to clipboard

switch (pEvent.Name)
case "start":
case "stop":
case "pause":
case "help/index":
case "help/about":
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice