KUIML
Blue Cat's User Interface Programming Language
Attributes Common to Text Widgets

Description

This section describes properties that are common to all widgets that can display text.

  • Formatted text elements may be single or multi-line.
  • The font, text decoration & color properties are by default inherited from the parent cell. It can be overridden for this particular text cell.
  • The total element size is by default automatically computed, taking the font and selected text to display into account. But the size can be forced (use the cell width & height attributes), and in this case the text is formatted according to 'multiline' and 'word_break' attributes values.

Inherited Attributes

See the Widgets element.

Specific Attributes

Name Value Type Default Value Description Comment V. Exp.

multiline

boolean

false

Enables or disables multiline in the text field.

If this attribute is not set to 'true', carriage return and line feed characters are not recognized, and word_break property will be inactive. This value is not inherited by children cells.

1.0

No

word_break

boolean

false

Enables or disables word - breaking at the end of a line.

This property is used when the width of the widget has been set. If word break and multiline are enabled, the system will display multiple lines when the length of the text to display is larger than the width of the widget.

This value is not inherited by children cells.

1.0

No

text_h_align

horizontal alignment

center

Horizontal alignment of the text.

This value is not inherited by children cells.

1.0

No

text_v_align

vertical alignment

center

Vertical alignment of the text.

This attribute is compatible with single line text fields only.

This value is not inherited by children cells.

1.0

No

background_color

color

empty

Background color to apply behind the text.

If this attribute is not set, the widget is transparent.

2.7.2

No

Note About Special Characters

In order to display special characters (most commonly used are line feed or carriage return), you need to use their HTML codes, as the XML norm specifies it. See http://www.w3.org/MarkUp/html-spec/html-spec_13.html for special character codes reference.

For example, in order to display the following string:

Hello
World

the corresponding 'value' XML attribute for the text field will be the following: Hello
World.


 stands for 'carriage return character'. See the examples below.

Examples

  • Display a simple single line text field with inherited font properties: the first line inherits from the global skin settings, and the second one from the global + cell settings.

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column"
   h_margin="10" v_margin="10" spacing="4" font_face="Tahoma" font_height="14" text_color="#ffffff"
   font_quality="cleartype">
   <TEXT value="This is a skin." />
   <CELL layout_type="row" spacing="10" h_margin="5" v_margin="5" font_height="25">
      <TEXT value="Hello World!" />
   </CELL>
</SKIN>
  • Display a multi line text field with a carriage return character, aligned to left:

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column"
   h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff"
   font_quality="cleartype">
   <TEXT multiline="true" font_face="Tahoma" value="This is a skin.&#13;Hello World!" text_h_align="left" />
</SKIN>
  • Display a multi line text field with a fixed width, enabling 'word_break' property. The height of the text field is computed by the system, while the width is fixed by the designer, and words are broken automatically.

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column"
   h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff"
   font_quality="cleartype">
   <TEXT multiline="true" width="150" font_face="Tahoma" value="This is a skin. Hello World!"
      text_h_align="left" word_break="true" />
</SKIN>
  • Display a multi line text field with text aligned to right:

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column"
   h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff"
   font_quality="cleartype">
   <TEXT multiline="true" font_face="Tahoma" value="This is a skin.&#13;Hello&#13;World!&#13;a&#13;b&#13;c"
      text_h_align="right" />
</SKIN>