[Xerte] How does Xerte handle style sheets?

Kemp Johnathan johnathan.kemp at ntlworld.com
Wed Feb 22 14:55:40 GMT 2012


I am developing a default rlo file for Xerte 2.18 individual page template
projects and have a working experimental layout editor included that sets
as many colours and positions for things as I can find how to do.

There are some settings that I have not found a way to set from a script so
these I have to set using a style sheet. The example in this case is the
titleBarColour.

I am experiencing something rather strange.

I have a style sheet and all it does is set the titleBarColour to red

colourScheme {
titleBarColour: 0xFF0000;
  }

If I load the style sheet via the property panel of the learning object
then all is well and all it does is set the titleBarColour to red and the
rest of the screen settings that I have set in code work correctly.

However if instead of using the property panel I use a field in the xwd
form associated with the learning object and then use the code

//stylesheet
if (templateData.learningObject[0].stylesheet != undefined){
rootIcon.loadStyleSheet(expression(templateData.learningObject[0].stylesheet,
this));
}

to load the style sheet, then all the colour settings that I have made by
script get reset. The screen flashes briefly with my set colours and then
reverts to the default colours other than those set in the style sheet.
Which is not what I want to happen.

I have attached a pdf with screen shots showing the difference.

Is there a way of loading the stylesheet using the xwd form without having
it overwrite the changes I have made in script?

Incidentally this even happens if I run my script to change the screen
settings after I run the script that loads the style sheet.

You can see settings such as button position persist, just the colours
settings are rendered ineffective.

Kind regards

Johnathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20120222/29d62f4a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: styleSheet test.pdf
Type: application/pdf
Size: 117104 bytes
Desc: not available
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20120222/29d62f4a/attachment-0001.pdf>


More information about the Xerte mailing list