addButtons.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/blue/styleBlue.js', 'A')

DFrameAPI.onLoad = function(){

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

var text = dFrame.addText([40, 30], 'The same array definition of Buttons is used to create<li>4 Buttons on the firstBar<li>A Menu with 4 items on the second Bar.<li>A context Menu with the 4 same items.')

text.setOverlayParentBars(true)

//DFrameAPI.preLoadImagesForButtonImage for 'Close' and 'Home' images in in styleBlue.js

var M = new Array()

//Button

M[0] = new Array('BUTTON', 'Button: Close', 'thisDFrame.closeFrame()')

//Standard Buttton

M[1] = new Array('STDBUTTON', 'StdButton: Close', 'CLOSE')

//ButtonImage

M[2] = new Array('BUTTONIMAGE', 'thisDFrame.closeFrame()', DFrameAPI.getImagesForButtonImage('Home'))

//Standard ButtonImage

M[3] = new Array('STDBUTTONIMAGE', 'CLOSE', DFrameAPI.getImagesForButtonImage('Close'))

//Add buttons with M

dFrame.addButtons(M)

//Add Menu on another bar with the same array M

var bar = dFrame.addBar()

bar.addMenu(M, null, 'Button for menu from buttons array', null)

//Add context Menu with the same array M

dFrame.addContextMenu(M)

dFrame.show()

}

</script>

</HEAD>

</HTML>