|
From: Harry E. <har...@us...> - 2006-09-18 07:59:08
|
Update of /cvsroot/synclast/client/examples/SynclastUIDemo/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31295/examples/SynclastUIDemo/res Added Files: form_midlet.css table_midlet.css Log Message: This is a complete revamp of the style mechanism in Synclast. The new mechanism works kind alike CSS layer 1 applied to widgets. You create a stylesheet with a string of text that looks like a css file (see examples/SynclastUIDemo/res/*.css for examples). You set the Stylesheet on a canvas. Widgets added to that canvas will automatically pick up the styling information assoiciated with that canvas. Styles cascade according to containment, ie, if a widget doe not have a background color style but its parent does, it will get the same background. Some styles cascade, and some do not. Styles only set the "default" values for a widget. Basically, calling set() to set a widget property wil ALWAYS override any value in the stylesheet. Stylesheets can be set on a canvas before or after it is constructed, and all widgets should end up properly getting styled in either case. This means you can also change the stylesheet on a canvas at any time you want. Since Stylesheets are just parsed from a string, they can come from anywhere (the jar, constructed on the fly, downloaded from the network, etc). Though Styles are designed to be efficient, treat them with care since very complicated pages might need non trivial time to derive all their values. Style documentation on each widget still needs to be added, along with default value and cascade information. Right now, the code IS the documentation in this regard. Please report bugs as you find them. --- NEW FILE: form_midlet.css --- input { background-color: 0xcccccc; } checkbox { background-color: 0xcccccc; border-color: 0xff0000; color: 0xff0000; } label { color: 0xffffff; } button { color: 0x000000; background-color: 0xcccccc; } --- NEW FILE: table_midlet.css --- table { border-width: 1; border-color: 0x000000; } coloredwidget { border-width: 0; } |