Styles are declared inside the form for user interfaces of all CWT models. Any number of styles can be defined in the form but each style must be given a unique name. Each style is defined with a <Style> element like this:
<Style def:Name='RejectButtonStyle'>
<StyleProperties>
<PropertyStyle Name='RejectButton'/>
<PropertyStyle Location='25, 305'/>
<PropertyStyle Size='124,38'/>
<PropertyStyle BackColor='Red'/>
<PropertyStyle ForeColor='Black'/>
<PropertyStyle Click='OnReject'/>
<PropertyStyle Font='Arial, 14pt, style=Bold'/>
</StyleProperties>
</Style>
Note that the Name property is defined with the prefix “def:” in the style declaration above. This is required to allow the software to find and use the style when it is applied to definition of the controls that shall use the style.
The line <PropertyStyle Name='RejectButton'/> above sets the Name property to “RejectButton” in the style. If the style is applied to a button the button's Name property will be set to “RejectButton”.
Sub-elements
Below is a list of the sub-elements that can be defined within a Style control. The sub-elements are used to add other controls to create a keyboard mapping for physical buttons in the terminal and to add a software DLL reference that is used when connecting actions to buttons, etc.
Sub-element |
Description |
---|---|
StyleProperties |
The StyleProperties element is a container for one or more PropertyStyle elements |
PropertyStyle |
Each property that is set in the style is declared with a PropertyStyle element. |