|
|
|
|
optionsMenu.js Functions
Libraries
TechNotes
|
|
The purpose of this library is to popup a drop down options menu as defined in the XML configuration file of the application.
The options menu contains entries to change the settings of the application, and contains a list of links. The list of links can be displayed in the options menu, or in a dedicated links menu.
More information: optionsMenu_show and linksMenu_show.
The MioScript library menu.js is required.
A standard XML configuration file must be used.
For more information: XML Configuration File Format.
Visibility of the Menu Items| |
In the XML configuration file, the tag <GENE_OMENU> is used to specify the visibility of each menu item.
The tag is a string build with 0 (hidden) or 1 (visible).
For example, all the entries are hidden with the following string:
000000
And all are visible with the following string:
1111111
Visibility of the menu entries is defined as follow:
ABCDEF
Where:
A = Open At Startup (the application must be installed)
B = Uninstall (the application must be installed)
C = Exit/Shutdown
D = About Dialog Box
E = Docking Position (docked window, such as a desktop ticker)
F = Scroll Speed (scrolling ticker)
G = Options Dialog Box
For example, the string 1111001 means: hide the docking position and the scroll speed, show the others.
If you are not using an XML configuration file, or if you want to overwrite the settings in the XML configuration file, you can set the variable GENE_OMENU.
Example:
|
Retrieving the Settings
| |
Links Menu
The list of links is defined in the XML Configuration File Format.
It is possible to retrieve the list in an array as follow:
menu_links = mioxml_extract(
xml_settings_xml, "//MIOAPP/LINKS/ITEM", "^^URL"); |
Where
menu_links[index] = "Title^^URL" |
open At Startup
When the user clicks on this option to set if the application should be loaded when windows starts, the MioScript function mio_openAtStartup.
The value of this setting is stored in the application data file and can be retrieved as follow:
var isOpenAtStartup = mio_data_get("OPEN_AT_STARTUP", "0") |
Scroll Speed
The speed of the scrolling text (more info: scrollingTicker.js)
The value of this setting is stored in the application data file and can be retrieved as follow:
var scrollSpeed = mio_data_get("SSPEED", "1") |
If you change the scrolling speed when some text is scrolling, you should apply the new speed immediately as follow:
document.getElementById('TICKER').scrollSpeed |
Dock Position
The docking position can be set to top or bottom.
The value of this setting is stored in the application data file and can be retrieved as follow:
var dockPosition = mio_data_get("DOCK", "top") |
|
Adding Items to the Options Menu
|
|
|