Syntax
| optionsMenu_show(showLinks, X, Y, language, additionalItems, functionName, functionName) |
Parameters
| BOOL | showLinks | If set to true, the list of links defined in the XML configuration file is added to the options menu. You can also show a menu with the links only: linksMenu_show.
| | INT | X | Optional. Position X of the menu. -1 (default value) for the horizontal position of the mouse.
| | INT | Y | Optional. Position Y of the menu. -1 (default value) for the vertical position of the mouse.
| | STRING | language | Optional. ENGLISH (default) for menu in English. FRENCH for menu in French. For other languages please send a request to support@mioplanet.com.
| | STRING | additionalItems | Optional. List of additional items, as follow: ITEMID_1:Label ITEMID_2:Label
| | STRING | functionName | Optional. Name of a function (no parenthesis) to be called when the user click on an item. The library will still proceed the items but you can add your own code. You can also proceed the additional items, if any.
| | STRING | functionName | Optional. Name of a function (no parenthesis) to be called when the application needs to know if an item is checked. Do not return any value for the items you want to checked automatically. |
Return value
No value is returned.
Description
Call this function to show the options menu, as defined in the XML configuration file.
The options menu contains entries to close the application, show the about dialog box, etc.
Each menu entry can be shown or hidden in the XML configuration file.
More info: XML Configuration File Format.
Possible standards entries:
| LINK | Open an URL. The URL is defined with the ID as follow:
LINK*http://...
| | UNINSTALL | The uninstall program is started.
| | OPEN_AT_STARTUP | Adds or remove the program in the Startup folder.
| | EXIT | Shutdowns the application.
| | DOCK | Changes the dock position.
For a Desktop News Ticker, the possible values are:
DOCK*top and DOCK*bottom.
| | SSPEED | Changes the speed of a scrolling ticker.
For a Desktop News Ticker, possible values are:
SSPEED*1, SSPEED*2 and SSPEED*3
| | ABOUT | Displays the about dialog box.
|
For more information: optionsMenu.js.
To create a custom menu: mio_menu.
Additional Menu Items
You can add items in the options menu. The items will be added at the bottom of the menu, just before the Shutdown item.
To add your own menu items, proceed as follow:
| {o} | Create a function that will return true or false if the item should be checked or not.
The first parameter of the function is the menu item ID.
You can also set if the standard menu items are to be checked or not. Your value will overwrite the default value.
| | {o} | Create a function that will be called when the user click on a menu item.
The first parameter of the function is the menu item ID.
| | {o} | Call the function with all the parameters. |
Customizing labels
You may need to customize the item's labels to localize the application or other.
You can set new values to the following variables before calling the function.
str_om_OPEN_AT_STARTUP = "Open at Startup"
str_om_UNINSTALL = "Uninstall"
str_om_DOCK_top = "Docked Up"
str_om_DOCK_bottom = "Docked Down"
str_om_SSPEED = "Scroll Speed"
str_om_SSPEED_0 = "Slow"
str_om_SSPEED_1 = "Medium"
str_om_SSPEED_2 = "Fast"
str_om_ABOUT = "About"
str_om_QUIT = "Shutdown"
|
Important: Do not specify a language when you call the function, otherwise the labels will be overwritten by the labels in the requested language.
JavaScript Sample Code
// Options Menu with additional items, displayed just under the mouse.
function onload() {
...
optionsMenu_show(true, -1, -1, "ENGLISH", "ITEM1:Custom Item 1<BR>ITEM2:Custom Item 2", "optionsMenu_click", "optionsMenu_getCheck")
}
function optionsMenu_click(menuItem) {
if(menuItem == "ITEM1") {
...
}
if(menuItem == "ITEM2") {
...
}
}
function optionsMenu_getCheck(menuItem) {
if(menuItem == "ITEM1") {
return(true) // this item will be checked
}
if(menuItem == "ITEM2") {
return(false) // this item will not be checked
}
} |
|
|