setIndent.html

<HTML>

<HEAD>

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

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

<script language="Javascript">

//Style

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

DFrameAPI.onLoad = function(){

dFrameStyle.setDragEnabled(true)

dFrameStyle.setIndentX(50)

dFrameStyle.setIndentY(50)

//In order empty floating Bars have not null dimensions

dFrameStyle.getDefaultBarStyle().setAutoWidth('')

dFrameStyle.getDefaultBarStyle().setAutoHeight('')

//============= dFrame1

var dFrame1 = new DFrame([11, 10, 60, 60], 'setIndent', dFrameStyle)

var x = dFrame1.getStyle().getDefaultBarStyle()

x.setPos([0, 0, 30, 30])

x.setIndentX(20)

x.setIndentY(20)

var bar = dFrame1.addBar()

bar.setBackgroundColor('red')

var bar = dFrame1.addBar()

bar.setBackgroundColor('blue')

var bar = dFrame1.addBar()

bar.setBackgroundColor('yellow')

var dFrameText = new DFrame([0, 0, 30, 30], 'test', dFrameStyle, dFrame1)

dFrameText.alert('some DFrame')

dFrame1.show()

//============= dFrame2

var dFrame2 = new DFrame([11, 10, 60, 60], 'setFreezeXXXSide', dFrameStyle)

var x = dFrame2.getStyle().getDefaultBarStyle()

x.setPos([0, 0, 30, 30])

x.setFreezeLeftSide()

x.setFreezeTopSide()

var bar = dFrame2.addBar()

bar.setBackgroundColor('red')

var bar = dFrame2.addBar()

bar.setBackgroundColor('blue')

var bar = dFrame2.addBar()

bar.setBackgroundColor('yellow')

var dFrameText = new DFrame([0, 0, 80, 80], 'test', dFrameStyle, dFrame2)

dFrameText.alert('some DFrame')

var text = dFrame2.addText('Note that each Bar is smaller than the previous one because each Bar freezes<br>some area and the remaining space becomes smaller and smaller.<br>In the same way dimensions of the DFrame have been set to [80, 80]', [2, 10])

text.setOverlayParentBars()

dFrame2.show()

//============= dFrame3

var dFrame3 = new DFrame([11, 10, 60, 60], 'setFreeze and setIndent', dFrameStyle)

var x = dFrame3.getStyle().getDefaultBarStyle()

x.setPos([0, 0, 30, 30])

x.setFreezeLeftSide()

x.setFreezeTopSide()

x.setIndentX(10)

x.setIndentY(10)

var bar = dFrame3.addBar()

bar.setBackgroundColor('red')

var bar = dFrame3.addBar()

bar.setBackgroundColor('blue')

var bar = dFrame3.addBar()

bar.setBackgroundColor('yellow')

var dFrameText = new DFrame([0, 0, 90, 90], 'test', dFrameStyle, dFrame3)

dFrameText.alert('some DFrame')

var text = dFrame3.addText('You can drag the dFrames to see how the freezeXXXSide and indent<br>parameters modify appearances.', [2, 10])

text.setOverlayParentBars()

dFrame3.show()

}

</script>

</HEAD>

</HTML>

</HTML>