helpSample.html

<HTML>

<HEAD>

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

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

<script language="Javascript">

//Style

DFrameAPI.include('dFrame/styles/blue/styleBlue.js')

//Global

var baseDocs, dFramePage, dFrameHelp, helpIndex

var basePathForIcons = 'dFrame/doc/ExamplesStyles/windows/'

DFrameAPI.onLoad = function(){

//Edit dFrameStyle

dFrameStyle.setIndentX(60)

dFrameStyle.setIndentY(60)

//preload the help.gif image

DFrameAPI.preLoadImagesForButtonImage('Help', basePathForCommonIcons,'help.gif')

baseDocs = new DFrame([5, 5, 85, 85], 'helpSample.html', dFrameStyle)

baseDocs.addTaskBar()

baseDocs.addButton('Open a dFrame with document 1', 'createDFrame("./helpSample/document1.html")')

baseDocs.addButton('Open a dFrame with document 2', 'createDFrame("./helpSample/document2.html")')

baseDocs.show()

}

function createDFrame(url) {

dFramePage = new DFrame([30, 30, 70, 70], '', dFrameStyle, baseDocs)

var x = dFramePage.getStyle().getDefaultTitleBarStyle()

//The helpURL variable is set in the onLoadDFrame funciton of each document

x.setButtonImage('Help', 'openHelp(thisDFrame.helpURL)')

dFramePage.addButton('Close', 'thisDFrame.closeFrame()')

dFramePage.addButton('Help', 'openHelp(thisDFrame.helpURL)')

dFramePage.setDragEnabled(true)

dFramePage.setURL(url)

}

function openHelp(url) {

//Create all the context for help

if (!dFrameHelp) {

//Create the base for Help

baseHelp = new DFrame([10, 10, 90, 90], 'baseHelp', dFrameStyle);

baseHelp.addButton('Close', 'thisDFrame.closeFrame()')

baseHelp.addTaskBar()

//Left side: Index

helpIndex= new DFrame([0, 0, 30, 100], 'index.html', dFrameStyle, baseHelp);

helpIndex.setURL('./helpSample/helpIndex.html')

helpIndex.getStyle().getDefaultTitleBarStyle().setHeight(0)

helpIndex.getStyle().getDefaultTitleBarStyle().setAutoHeight('')

helpIndex.addToTaskBars(false)

//For links in Index

helpIndex.setTarget('openHelpRightPage()')

//dFrameHelp is opened in a separate function as it is also the target for helpIndex

openHelpRightPage(url)

}

//In case the help url has not been set in the onLoadDFrame function of a document

if (typeof(url) != 'string') url = './helpSample/welcome.html'

dFrameHelp.setURL(url)

}

function openHelpRightPage(url) {

var position = [40, 0, 100, 100]

position[0] = [helpIndex, 'RIGHT', 0]

dFrameHelp = new DFrame(position, 'dFrameHelp', dFrameStyle, baseHelp);

dFrameHelp.getStyle().getDefaultTitleBarStyle().setHeight(0)

dFrameHelp.getStyle().getDefaultTitleBarStyle().setAutoHeight('')

dFrameHelp.addToTaskBars(false)

return dFrameHelp

}

</script>

</HEAD>

</HTML>