PARAM_TEXT
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.
Attributes brief detailed show all inherited
Examples
Most examples of the 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:
- <!-- create a param -->
- <PARAM id="A" min="-20" max="20" default="0" unit="dB" />
- <!-- display value of a param surrounded by background to see the area -->
- <WIDGET background_color="#555599">
- <PARAM_TEXT param_id="A" content="{value} {unit}" value_format="+03.0" font_face="Courier" font_size="18" text_color="#FFFFFF" />
- </WIDGET>
- <!-- layout with slider -->
- <COLUMN width="150" v_margin="10">
- <TEXT value="A" />
- <LM_SLIDER_A param_id="A" />
- <PARAM_TEXT_CONTROL param_id="A" />
- </COLUMN>

To replace the 0 padding with blank space, we just remove the '0' in value_format. Another example where the positive values do not show the + sign, but a blank instead (replace the '+' with ' '). 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). See several examples of value_format below:
- <!-- create a param -->
- <PARAM id="A" min="-20" max="20" default="0" unit="dB" />
- <!-- display value of a param with various value_formats -->
- <ROW spacing="5">
- <REPEAT index_list="+03.0;+3.0; 3.0; 5.1">
- <COLUMN spacing="5">
- <TEXT value="'$index$'" font_face="Courier" />
- <WIDGET background_color="#555599" text_color="#FFFFFF">
- <PARAM_TEXT param_id="A" content="{value} {unit}" value_format="$index$" font_face="Courier" font_size="20" />
- </WIDGET>
- </COLUMN>
- </REPEAT>
- </ROW>
- <!-- layout with slider -->
- <COLUMN width="150" v_margin="10">
- <TEXT value="A" />
- <LM_SLIDER_A param_id="A" />
- <PARAM_TEXT_CONTROL param_id="A" />
- </COLUMN>

If you want to control param values see PARAM_TEXT_CONTROL and PARAM_TEXT_EDIT_BOX.
Descendent elements
Comments
Please, authorize to view and post comments.