5.1.3 Themes, Draw Styles and Styles working together

Themes, which incorporate Draw Styles, and Styles work on the simple basis that Styles are cumulative. To understand this, you need to look at how Draw Styles and Styles are applied not to the whole Web Application but to individual controls within the Web Application. The hierarchy of processing is as follows:

Default

The default appearance of the control is applied

Theme

Styles adopted from Themes Draw Styles are layered on top

Style

Individual Styles are used to apply any final details to the appearance.

 

All controls have a default appearance.

When a Theme is applied, whether a System Theme or a User Defined Theme, a set of Draw Styles are defined which are based on a set of individual Styles. Each Style is used for a mode of the DrawStyle such as MouseOver, Pressed, Focus, Selected and so on. When a Theme is used, these Draw Styles are applied to the controls in your application either automatically or specifically, giving it the characteristics associated with the associated styles. There are two variations of Draw Style.

Control Theme Draw Styles 

Control Theme Draw Styles are a predefined set of Draw Styles which are applied automatically with no additional user input. Thus, the Edit Draw Style applies to all input boxes such as fields and spin edits; ListItem applies to all entries in the List control; MenuItem applies to menu items, PushButton applies to Push Buttons and so on.

For example, if you have a push button and apply a Draw Style that makes the font bold and underlined, the button will have bold, underlined text. All other styling will remain as is. If you then apply a local style that makes the font blue, it will have bold, underlined and blue text.

Theme Draw Styles

Theme Draw Styles are abstract Draw Styles that can be used wherever appropriate. Title, Heading1, Heading2, Heading3 and so on are predefined names that exist by default in all basic System Themes. They have no particular meaning as such, other than to provide a set of basic Draw Styles that will exist in every Theme. These must be explicitly applied to a control when developing the application.

You can create your own Draw Styles using any naming convention you like.

Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Label1') Displayposition(2) Height(25) Parent(#COM_OWNER)Width(120) Themedrawstyle('Heading1')

Refer to the Visual LANSA Developer's Guide for more information on Themes and Draw Styles.