Presentation styles / Using presentation styles |
Styles can be defined to be global (for all elements), for an element in general, or for specific types of an element.
In the definition of a style, the 'name' attribute is used as a selector to apply style attributes to graphical elements.
You can define a style as global or specific to a class of graphical object:
A style identified by a star (*) is a global style that is automatically applied to all elements:
<Style name="*" >
A style identified by an element-type is a global style that is automatically applied to all objects of this type:
<Style name="Window" > <Style name="Edit" > <Style name="ComboBox" >
A style identified by a style-name is a specific style that can be applied to any element types using that style:
<Style name=".important" > <Style name=".smallfont" >
A style identified by an element-type followed by a dot and a style-name is a specific style that will only be applied to elements of the given type:
<Style name="Window.main" > <Style name="Edit.mandatory" >
When different styles can be applied to an element, the following priority, from the most precise to the most generic, is used to determine the style definition to be applied:
For instance, to find the style which will be applied to an Edit having the style attribute set to 'mandatory', the following styles will be analyzed: