Go to content Go to navigation

TPDesign4: State Properties - Text

26 June 2007, 10:28 by Chad Reynoldson

I have just been told about a G4 gem in the rough, where you can embed formatting codes in the text field of a button and have the panel replace the button text automatically.

My example: a bargraph uses the $P formatting value in the text property. The panel will automatically replace $P with the percentage value of the bargraph. Very nice!

From the TPDesign4 help file:
Text – To change or enter the text to be displayed on the selected state(s), click the browse button (…) to open the Enter Text dialog, where you can type the new button text. Use the Preview Using Font option to view the text as it will appear in the selected font, style and size (on by default).

Unicode characters may be entered via the Enter Text dialog only (not through in-place editing in the States tab of the Properties Control window). When Unicode text is input, the name of the button will not match it’s Off state text.

Formatting codes can be used in the state text for bargraph and multi-bargraph buttons. The following formatting codes will be replaced with the identified values:

$P – level percentage
$V – raw level value
$L – range low
$H – range high
$A – adjusted level value (raw level value – range low)
$R – range (range high – range low)
$$ – $ character

Comments

Comments are turned off for this article.