Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | JavaScript | optionsMenu.js SEARCH    

optionsMenu.js

  Functions
linksMenu_show
optionsMenu_show

  Libraries
alertEngineEx.js
channels.js
gui.k
mioEngine.js
optionsMenu.js
popupAlert.kLIB
popupAlertEx.js
scrollingTicker.js
stats.js
window_resizable.k
xmlFeed.js
xmlSettings.js

  TechNotes
Adding a Login feature
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to debug
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Statistics: How to track users and actions
XML Configuration File Format

Library
optionsMenu.js

Language: JavaScript
Product: MioFactory


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:

GENE_OMENU = "1111111"


 

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


 
You can add menu items if required.
Read optionsMenu_show for more information.
 



Library optionsMenu.js

Functions

linksMenu_show  |  optionsMenu_show