[Xerte] Re: How does Xerte handle style sheets?
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Wed Feb 22 15:26:00 GMT 2012
Can you try the engine in the svn? I did some work on loadstyles last week,
________________________________________
From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan [johnathan.kemp at ntlworld.com]
Sent: 22 February 2012 14:55
To: Xerte discussion list
Subject: [Xerte] How does Xerte handle style sheets?
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
More information about the Xerte
mailing list