addMenu.html

<HTML>

<HEAD>

<script>var dFrameFilePath = '../../../../../dFrame/'</script>

<script language="Javascript" src="../../../../../dFrame/dFrame/lib/DFrameAPI.js"></script>

<script language="Javascript">

//Style

DFrameAPI.include('../../ExamplesStyles/clean/styleClean.js', 'A')

//DFrameAPI.include('../../ExamplesStyles/colors/styleColors.js', 'A')

var bn

DFrameAPI.onLoad = function(){

//DFrameAPI.checkStyles(true)

var dFrame = new DFrame([10, 10, 90, 90], 'addMenu.html', dFrameStyle)

dFrame.addText([20, 20], '3 Menus starting from the same Menu arrays definitions:<li>Tree Menu.<li>Pop-up Menu.<li>Context Menu (right-click on mouse).')

//Define arrays for a sub menu

subMenuDef = new Array()

subMenuDef[0] = new Array('Button', 'New', 'alert("Click !")')

subMenuDef[1] = new Array('Button', 'Open', 'alert("Click !")')

//Define arrays for the main menu

var menuDef = new Array()

menuDef[0] = new Array('Button', 'Documents', subMenuDef)

menuDef[1] = new Array('Button', 'Exit', 'thisDFrame.closeFrame()')

//Add a tree Menu, on a vertical bar

var bar = dFrame.addBar('LEFT')

var menu2 = bar.addMenu(menuDef);

menu2.setIsTree(true)

menu2.setBordersWidth([1, 0])

//Add a pop-up Menu

var bar = dFrame.addBar('TOP')

var menu1 = bar.addMenu(menuDef, null, 'File', null);

menu1.setIsTree(false)

//Add a context Menu

var menu3 = dFrame.addContextMenu(menuDef);

dFrame.show()

}

</script>

</HEAD>

</HTML>