dynapi.gui.HTMLMenu- Quick Reference

Inherit: HTMLComponent

Constructor

HTMLMenu(css,orientation)
...
css                - (String) Class name to use on menu
orientation    - (String) Sets the orientation (horz or vert) of the menu. Defaults to "horz"

Events

onclick(e) 
...

Design Properties

selBgCol
...
mnuItmWidth
...
mnuItmHeight
...
mnuArrow
...
sndOnMenuopen
Plays a FlashSound target & frame whenever a menu pops up.

Public Methods

createMenuBar(id,itmWidth,itmHeight,subMnuOffset)
...
example:
var mbar = mnu.createMenuBar('main',40,20);
mbar.addItem(null,'File','file');
mbar.addItem(null,'Edit','edit');
mbar.addItem(null,'View','view');
mbar.addItem(null,'Tools','tools');
mbar.addItem(null,'Help','help');


Where mbar.addItem() is a reference to HTMLMenu._addItem

 
getInnerHTML()
... 

Private Methods

_assignElm()
....
_buildMenu()
...
_changeCol(changeArray, isOver)
...
_e(evt,mnuNum,itmNum)
...
_getTree(mnuNum,itmNum)
...
_showOnly(mnuNum)
...

Static Methods

HTMLMenu._addItem(css,text,linkId,callback,length,spacing,backCol,selBgCol,cssText)
Add an item to a Menu Bar and return the item's id. The menu item id is a combination of the menu bar's id and the item number.

exmaple:
var mbar = mnu.createMenuBar('main',40,20);
var id1 = mbar.addItem(null,'File','file'); // id1 = 'main1'
var id2 = mbar.addItem(null,'Edit','edit'); // id2 = 'main2'

// to add images use:
var img = dynapi.functions.getImage('images/menu_settings.gif',16,22,{
	align:"absmiddle",
	oversrc:'images/menu_settings_on.gif'
});
var id3 = mbar.addItem(null,{image:img,text:'Exit'}); // id3 = 'main3'