styleWindows.js

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

basePathForCommonIcons = 'dFrame/images/common/'

DFrameAPI.preLoadImagesForButtonImage('CloseDFrame', basePathForCommonIcons,'close-off-02.gif', 'close-on-02.gif', 'close-off-02.gif', 'close-on-02.gif')

DFrameAPI.preLoadImagesForButtonImage('HideDFrame', basePathForCommonIcons,'hide.gif', 'hideOver.gif', 'hide.gif', 'hide.gif')

darkBlue = '#000084'

lightGray = '#D4D0C8'

darkForBorders = '#A0A0A0'

lightForBorders = '#FFFBF0'

//============================================================================

// buttonStyle |

//============================================================================

buttonStyle = new ButtonStyle()

buttonStyle.setWidth(80)

buttonStyle.setHeight(18)

buttonStyle.setFontSize(1)

buttonStyle.setActivateOn('UP');

buttonStyle.setCloseImage('CloseDFrame')

buttonStyle.setTextNormal('#000000')

buttonStyle.setBgNormal(lightGray)

buttonStyle.setBordersNormal(false)

buttonStyle.copyStyle('Normal', 'Roll')

buttonStyle.setBordersRoll('ThreeD')

buttonStyle.copyStyle('Normal', 'Down')

buttonStyle.setBordersDown('ThreeDInv')

buttonStyle.copyStyle('Normal', 'Selected')

buttonStyle.copyStyle('Roll', 'RollSelected')

//============================================================================

// menuStyle |

//============================================================================

var menuStyle = new MenuStyle()

menuStyle.setBordersWidth(1)

menuStyle.setBordersType('ThreeD')

menuStyle.setBackgroundColor(lightGray)

menuStyle.setImageArrowOff(basePathForCommonIcons + 'menuArrow-Close.gif')

menuStyle.setImageArrowOn(basePathForCommonIcons + 'menuArrow-Open.gif')

//------------------------------------------------------------------

// default Button Style |

//------------------------------------------------------------------

var x = new ButtonStyle(buttonStyle)

x.setActivateOn('OVER')

menuStyle.setDefaultButtonStyle(x)

//------------------------------------------------------------------

// itemsStyle |

//------------------------------------------------------------------

var x = new ButtonStyle(buttonStyle)

x.setBordersWidth(1)

x.setBordersColor(lightGray)

x.setWidth(80)

x.setAutoWidth('LABEL')

x.setHeight(15)

x.setActivateOn('Down');

x.setLabelLeftMargin(3);

x.setLabelHAlign('LEFT')

x.setBordersWidth(1)

x.setTextRoll('#ffffff')

x.setBgRoll('#000084')

x.copyStyle('roll', 'rollSelected')

x.setImageNormal(basePathForIcons + 'transparent.gif')

x.setImageRoll(basePathForIcons + 'transparent.gif')

x.setImageSelected(basePathForIcons + 'selected.gif')

x.setImageRollSelected(basePathForIcons + 'selected.gif')

x.setLabelLeftMargin(20);

menuStyle.setItemsStyle(x)

//============================================================================

// barStyle |

//============================================================================

barStyle = new BarStyle()

barStyle.setPos('TOP')

barStyle.setHeight(26)

barStyle.setBordersHMargin(2)

barStyle.setBordersWidth(1)

barStyle.setBordersType('ThreeD')

barStyle.setBackgroundColor(lightGray)

barStyle.setItemsHSpacing(3)

//------------------------------------------------------------------

// default Button and /Menu Styles |

//------------------------------------------------------------------

barStyle.setDefaultButtonStyle(buttonStyle)

barStyle.setDefaultMenuStyle(menuStyle)

//============================================================================

// dFrameStyle |

//============================================================================

dFrameStyle = new DFrameStyle()

dFrameStyle.setPos([0,0,75,75])

dFrameStyle.setIndentX(25)

dFrameStyle.setIndentY(25)

dFrameStyle.setBackgroundColor(lightGray)

dFrameStyle.setTitleBar(true)

dFrameStyle.setBordersLightThreeD(lightForBorders)

dFrameStyle.setBordersDarkThreeD(darkForBorders)

dFrameStyle.setBordersWidth(2)

dFrameStyle.setBordersType('ThreeD')

dFrameStyle.setMBordersWidth(2)

dFrameStyle.setIBordersWidth(2)

dFrameStyle.setIBordersType('ThreeDInv')

dFrameStyle.setScrollType('scroll')

dFrameStyle.setContentBgColor(lightGray)

dFrameStyle.setMessageBgColor('blue')

//------------------------------------------------------------------

// default Bar Style |

//------------------------------------------------------------------

dFrameStyle.setDefaultBarStyle(barStyle)

//------------------------------------------------------------------

// defaul tTask Bar Style |

//------------------------------------------------------------------

var x = new BarStyle(barStyle)

var y = x.getDefaultButtonStyle()

y.setImageNormal(basePathForIcons + 'transparent.gif')

y.setImageRoll(basePathForIcons + 'transparent.gif')

y.setImageSelected(basePathForIcons + 'selected.gif')

y.setImageRollSelected(basePathForIcons + 'selected.gif')

y.setLabelLeftMargin(20);

dFrameStyle.setDefaultTaskBarStyle(x)

//------------------------------------------------------------------

// default Context Menu Style !

//------------------------------------------------------------------

var x = new MenuStyle(menuStyle)

dFrameStyle.setDefaultContextMenuStyle(x)

//============================================================================

// defaultTitleBarStyle |

//============================================================================

var x = new BarStyle(barStyle)

x.setBackgroundColor('#000084')

x.setBordersWidth(0)

x.setBordersHMargin(5)

x.setBordersVMargin(2)

x.setHeight(1)

x.setButtonImage('thisDFrame.closeFrame()', DFrameAPI.getImagesForButtonImage('CloseDFrame'))

var y = x.getDefaultButtonStyle()

y.setHeight(0)

y.setBordersWidth(0)

y.setLabelTopMargin(1)

y.setLabelBottomMargin(1)

y.setBgNormal(null)

y.setTextNormal('white')

y.setBosNormal(true)

//------------------------------------------------------------------

// defaultTitle Bar for Bar !

//------------------------------------------------------------------

dFrameStyle.setDefaultTitleBarStyle(x)

//------------------------------------------------------------------

// default Title Bar for a special DFrame !

//------------------------------------------------------------------

var dFrameStyleHide = new DFrameStyle(dFrameStyle)

var x = dFrameStyleHide.getDefaultTitleBarStyle()

x.setButtonImage('thisDFrame.show(false)', DFrameAPI.getImagesForButtonImage('HideDFrame'))