KUIML
Blue Cat's User Interface Programming Language
PARAM_TEXT

Description

Passive element (does not respond to mouse or keyboard) that displays a parameter as formatted text. It is like a Attributes Common to Text Widgets widget except that the string to display is generated from the parameter attributes.

Inherited Attributes

See Attributes Common to Text Widgets.

Specific Attributes

Name Value Type Default Value Description Comment V. Exp.

param_id

param id

empty

Identifier of the parameter to display.

This value is mandatory. Param controls cannot not refer to a an output param since output parameters are read-only.

1.0

No

content

string with param fields

'{value} {unit}'

Content to display


1.0

No

value_format

param value formatting

' .1'

Format of the 'value' field

The default format shows the value with one character for the decimal part, and positive values start with a blank.

1.0

No

value_suffix

boolean

'false'

If the value is too small or too big, the system will use a suffix for the value, such as 'k' for kilo, 'M' for Mega, or 'm' for 'milli'.


1.1

No

significant_digits

positive integer value

0

Number of significant digits to display, forcing the system to perform rounding.

With significant_digits set to 2, "45678" will be displayed as 46000, and "0.654" will be displayed as 0.65. Set this parameter to 0 to disable rounding.

1.7

No

Examples

Most examples of the Attributes Common to Text Widgets chapter are applicable here. Only specific features of the param text widget are shown here.

  • Display the value and unit of the parameter, the value having a fixed number of characters: note that we used a fixed size font so that the overall text size does not change when the value changes:

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" font_face="Lucida Console" text_color="#ffffff"
   font_quality="cleartype" font_height="12" h_margin="2" v_margin="10">
   <PARAM_TEXT param_id="dsp.input1" content="{value} {unit}" value_format="+03.0" />
</SKIN>
(the pictures show the widget for different values of the parameter)
  • To replace the 0 padding with blank space, we just remove the '0' in value_format.

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" font_face="Lucida Console" text_color="#ffffff"
   font_quality="cleartype" font_height="12" h_margin="2" v_margin="10">
   <PARAM_TEXT param_id="dsp.input1" content="{value} {unit}" value_format="+3.0" />
</SKIN>
(the pictures show the widget for different values of the parameter)
  • Here is an example where the positive values do not show the + sign, but a blank instead (replace the '+' with ' '):

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" font_face="Lucida Console" text_color="#ffffff"
   font_quality="cleartype" font_height="12" h_margin="2" v_margin="10">
   <PARAM_TEXT param_id="dsp.input1" content="{value} {unit}" value_format=" 3.0" />
</SKIN>
(the pictures show the widget for different values of the parameter)

  • In order to see one digit, we replace '.0' at the end of the value_format string with '.1', and replace 3 with 5 since now we will need 5 characters instead of 3 (one for the '.' and one for the digit):

<?xml version="1.0" encoding="utf-8" ?>
<SKIN language_version="1.0" background_color="#000000" font_face="Lucida Console" text_color="#ffffff"
   font_quality="cleartype" font_height="12" h_margin="2" v_margin="10">
   <PARAM_TEXT param_id="dsp.input1" content="{value} {unit}" value_format=" 5.1" />
</SKIN>
(the pictures show the widget for different values of the parameter)