Page 1 of 1

Creating Application Skins with Appearance Behaviors

Posted: Mon Nov 16, 2009 12:11 am
by dickey
Hello All,

Behaviors (introduced in V3.5), allow one object to inherit the script of another object. A very powerful and time saving feature. Before I even knew what behaviors were in a Revolution context, I envisaged that they would provide a means of skinning an application. I was wrong, but thought my idea seemed logically sound.

You might have an IDE interface panel that would allow you to create a new custom controls template (akin to a style sheet), whereby you set the appearance of standard controls or you import custom controls in your template as desired.

Then, when working in the IDE you would have the ability to set an `Appearance Behavior` for style and appearance and a `Script Behavior` for inheriting scripts (the latter available since V3.5).

There would then be an opportunity for designers to publish their custom control templates as theme stacks, and over time a library of pre-build skins would emerge, as would the sale of professionally designed theme packs - as in the web world). You may wish to set the appearance of all controls from the template globally (something like: set the global appearance template of stack "my stack" to that of "Template 47", or you may wish to set them using the set `Appearance Behavior` on a control by control basis. Say for example, set the behavior of a button to the button appearance of Template 5, set the behavior of a label to the label style of Template 17 etc.

In theory then, the order of precedence of these behaviors would be that `Appearance Behaviors` are processed first, allowing them to be modified by the `Behavior Script`, before they are rendered to screen.

My motivation for posting, was reading kotikoti's post on the subject of 'Tools for skinning the UI of an application' available here http://forums.runrev.com/phpBB2/viewtopic.php?t=4276, and my belief that it was no real leap to achieve this functionality within the IDE.

This also makes sense to me in respect of RunRev's drive to the web, in that ease of skinning applications is handled well in the web world.

I trust this makes sense, and hope others might see this as advantageous.

Please let me know your thoughts.

Kind regards,

Andrew

Posted: Mon Nov 16, 2009 10:40 am
by Janschenkel
Well, two features of behaviors that help for 'skinning' purposes
- special events: they are sent a 'preOpenControl' message before they become visible on-screen; and they are continuously sent the 'resizeControl' message as you resize them in the IDE
- image searching: if you have special artwork for corners, etc. then you can place these next to the behavior script control; and the engine will look there first when drawing the screen

But you'll still be spending quite some time getting your behavior and appearance right to create a custom control. As a reward, fixing any bugs in the behavior will fix them everywhere :-)

Jan Schenkel.

Creating Application Skins with Appearance Behaviors

Posted: Tue Nov 17, 2009 12:20 pm
by dickey
Jan, thanks for your reply, I was attempting to research what you describe as 'special events', but found zip. If you have time, could you explain further?

Kind regards,

Andrew