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

  Functions
alertEngine_init
alertEngine_popup_hide
alertEngine_processed
array_addIfNotExists
array_indexOf
array_insertItem
array_removeItem
blink_set
call_callback
channels_feeds_get
channels_feeds_getByCategory
channels_feeds_getIndex
channels_get_allCategories
channels_get_categories
channels_get_value
channels_init
channels_latestNews_clear
channels_latestNews_countUnread
channels_latestNews_getNextUnread
channels_latestNews_getReadMark
channels_latestNews_hasUnread
channels_latestNews_setAllReadMarks
channels_latestNews_setReadMark
channels_loadFromMemory
channels_readMarks_countUnread
channels_readMarks_nextUnread
channels_readMarks_setAllAsRead
channels_set_value
comma
disableOnSelectStart
echo
error
isNumber
linksMenu_show
log
logIsEnabled
mailTo
mioxml_createObject
mioxml_download
mioxml_extract
mioxml_getElement
mioxml_getElementArray
mio_alert
mio_autoRestart
mio_autoShape_apply
mio_autoShape_end
mio_autoShape_start
mio_close
mio_createDownloadID
mio_data_get
mio_data_getBool
mio_data_load
mio_data_save
mio_data_set
mio_dialog
mio_dialog_close
mio_dialog_html
mio_execScript
mio_fadeIn
mio_fadeOut
mio_file_get
mio_file_load
mio_file_save
mio_maintenance
mio_menu
mio_openAtStartup
mio_openURL
mio_restart
mio_run
optionsMenu_show
replace
sendToMio
start_download_channels
stats_software_send
stats_trackingID_send
str_decrypt
str_encrypt
str_posEx
text_ellipsis
ticker_add
ticker_get_scrolling_text
ticker_scroll_restart
ticker_set_callback
ticker_set_text
ticker_start
ticker_staticMessage
trim
xmlfeed_load
xmlfeed_readMarks_clear
xmlfeed_readMarks_isRead
xmlfeed_readMarks_isUnread
xmlfeed_readMarks_load
xmlfeed_readMarks_save
xmlfeed_readMarks_setAsRead
xmlfeed_readMarks_setAsUnread
xml_settings_ads_get
xml_settings_appUpdate
xml_settings_download
xml_settings_getLocalVersion
xml_settings_menu_get

  Events
all_channels_refreshed
latest_news_onchange

  Variables
alertEngine_default_textColor
alerts_bag[][]
alert_history_max
alert_toPopup_max
channels_bag[][]
channel_id[]
current_alert
current_alert_id
current_channel
current_channel_id
current_software
current_software_id
default_channels[]
default_channels_count
enabled_channels[]
enabled_channels_count
feeds_data[][]
isDownloading
latest_news[]
latest_news_count
MAX_HISTORY_ITEMS
MAX_HISTORY_LENGTH
MAX_LATEST_NEWS_ITEMS
MAX_LATEST_NEWS_LENGTH
MAX_LATEST_NEWS_PER_CHANNEL
MAX_NEWS_PER_FEED
MAX_READMARKS
mioData
MIO_XML
server_http_root[]
server_stats_root[]
software_bag[][]
software_id[]
tab_accounts
TICKER_PAUSED
TICKER_SCROLL_RATES
TICKER_SCROLL_STEPS
username
xdata_alertsActive[]
xdata_alertsHistory[]
xdata_alerts[]
xdata_channels[]
xdata_software[]
XML Alerts Feeds
xml_settings_obj
xml_settings_xml

  Libraries
Admin Panel JavaScript Library
alertEngineEx.js
channels.js
mioEngine.js
miolib.js
optionsMenu.js
popupAlertEx.js
scrollingTicker.js
stats.js
xmlFeed.js
xmlSettings.js

Function
optionsMenu_show

Language: JavaScript
Product: MioFactory


Syntax

optionsMenu_show(showLinks, X, Y, language, additionalItems, functionName, functionName)


Parameters

BOOLshowLinksIf 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.
INTXOptional.
Position X of the menu. -1 (default value) for the horizontal position of the mouse.
INTYOptional.
Position Y of the menu. -1 (default value) for the vertical position of the mouse.
STRINGlanguageOptional.
ENGLISH (default) for menu in English.
FRENCH for menu in French.
For other languages please send a request to support@mioplanet.com.
STRINGadditionalItemsOptional.
List of additional items, as follow:
ITEMID_1:Label
ITEMID_2:Label
STRINGfunctionNameOptional.
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.
STRINGfunctionNameOptional.
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:

LINKOpen an URL. The URL is defined with the ID as follow:
LINK*http://...
UNINSTALLThe uninstall program is started.
OPEN_AT_STARTUPAdds or remove the program in the Startup folder.
EXITShutdowns 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
    }
}



Library optionsMenu.js

Functions

linksMenu_show  |  optionsMenu_show