[Xerte] Re: How does Xerte handle style sheets?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Fri Feb 24 09:50:14 GMT 2012


I think you probably want an event broadcasting 'onLoadStyles' that you can listen for and then make your scripted changes in the event response. I've just added that.

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Kemp Johnathan
Sent: 22 February 2012 16:14
To: Xerte discussion list
Subject: [Xerte] Re: How does Xerte handle style sheets?

There have been so many releases of key files that I have tended to keep the old copies.

I have worked my way through the previous releases of XMLengine.swf and it appears to have been a change that came in with the version with a date stamp of the 8th of February. The version of the 4th of February allows the combination of xwd stylesheet and scripted settings to co-exist. The version released on the 8th Feb resets the scripted colour changes.

Hope that helps narrow it down a bit.

Kind regards

Johnathan

On 22 February 2012 15:26, Julian Tenney <Julian.Tenney at nottingham.ac.uk<mailto:Julian.Tenney at nottingham.ac.uk>> wrote:
Can you try the engine in the svn? I did some work on loadstyles last week,
________________________________________
From: xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk> [xerte-bounces at lists.nottingham.ac.uk<mailto:xerte-bounces at lists.nottingham.ac.uk>] On Behalf Of Kemp Johnathan [johnathan.kemp at ntlworld.com<mailto: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
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk<mailto:Xerte at lists.nottingham.ac.uk>
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20120224/ae0a8402/attachment.html>


More information about the Xerte mailing list