|
OnGetScriptMenu
The OnGetScriptMenu event is fired when some of the
Messenger Plus! menus are displayed. It allows scripts to return
their own menu to be added to Messenger Plus!'s one.
Syntax
[string] OnGetScriptMenu(
[enum] Location
);
Parameters
- Location
-
[enum] A number specifying the
location of the menu that triggered the event. You can use this
parameter to display a different menu depending on what the current
user is currently doing.
- It can be one of the following values:
-
|
MENULOC_CONTACTLIST (1)
MENULOC_CHATWND (2)
MENULOC_MOBILEWND (3)
|
Contact List
Messenger Chat Window
Mobile Device Chat Window
|
Return Value
An XML data string defining the script's menu. If no menu is
required, return an empty string. For more information about the
way to define the menu's data, see the ScriptInfo's schema
documentation.
Remarks
The script's menu can be defined statically in the ScriptInfo.xml file or returned by this function
is its content needs changes at runtime. If a menu is returned by
this handler, it gets priority over the menu defined in
ScriptInfo.xml.
If an item of the script's menu is selected by the current user,
an OnEvent_MenuClicked
is fired.
Messenger Plus! 4.23 and earlier: enumeration names are not
available, numbers must be used instead.
Messenger Plus! 4.50 and earlier: MENULOC_MOBILEWND is not
supported.
Example
Event handler generating a simple menu for the script:
function OnGetScriptMenu(Location)
{
var ScriptMenu = "<ScriptMenu>";
ScriptMenu += "<MenuEntry Id=\"MnuFeat1\">Feature 1</MenuEntry>";
ScriptMenu += "<MenuEntry Id=\"MnuFeat2\">Feature 2</MenuEntry>";
ScriptMenu += "<Separator/>";
ScriptMenu += "<MenuEntry Id=\"MnuAbout\">About...</MenuEntry>";
ScriptMenu += "</ScriptMenu>";
return ScriptMenu;
}
Event Information
| Event Source |
Messenger Plus! |
| Availability |
Messenger Plus! Live 4.00 |
See Also
Messenger Plus! Events,
ScriptInfo's
schema documentation, OnEvent_MenuClicked.
|