The construction of a Style is not complicated but may be delicate and may sometime take a long time (220 methods for the all 4 Styles, fortunately all values have a default value).
So it is recommended the Styles are reusable:
It will be easy to include them in HTML pages and if the Style file is modified the modification will take effect in all pages.
Specifics Styles of the application, derived from the basics Styles stored in the .js file will be describe inside the HTML pages or, better, in an additional .js files.
If doing so the base file for the Style will remain clean and reusable:
In the base Style definition file:
var dFrameStyle = new DFrameStyle()
… definitions of the Style …
In an additional file or in mainPage:
dFrameStyle.setXXX… (additional definitions or/and modifications of dFrameStyle)
or
var specificDFrameStyle = new DFrameStyle (dFrameStyle)
… additional definitions or/and modifications for specificDFrameStyle …
Demo
file: dFrame/doc/documentation.html
Run the example: You are
currently running it.
In documentation.html:
<script language="Javascript">
…
DFrameAPI.include('styles/windows/styleWindows.js')
DFrameAPI.include('styles/windowsForHelp/styleWindowsForHelp.js')
…
See the styleWindowsForHelp.js file
The use of standard names will allow you to replace one set of Style definitions by an other one without having to modify the code of the application.
Recommended names for Styles are the name of the class with a lower case for the first letter: dFrameStyle, barStyle, buttonStyle and menuStyle.