sId | (String) Identifier of the menu item.
This identifier can be used in the 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 when calling a method). |
sOptions | [optional] (String) Additional parameters added items. Entries are in the KeyVal format, for example "type:text;enabled:1;text2:Ctrl+I;".
"type:sss;" (optional) - Specifies the type of added item.
type:text; (default) - The added item is text.
"enabled:n;" (optional) - Specifies whether the added item is allowed or disabled.
enabled:1; (default) - enabled
|
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");
switch (pEvent.Name)
{
case "start":
pMe.PmPanel.Methods.Start();
break;
case "stop":
pMe.PmPanel.Methods.Stop(1);
break;
case "pause":
pMe.PmPanel.Methods.Stop(0);
break;
case "help/index":
pMe.PmPanel.Methods.ShowHelpIndex();
break;
case "help/about":
pMe.PmPanel.Methods.ShowAboutDlg();
break;
}