textdisplay(
COLOR
,
STYLE
,
TEXT
)

The textdisplay( function works with Text Display Objects to control the color and style of text on the fly.


Parameters

This function has three parameters:

color – is the color that should be used to display the text. See the rgb( function. If you pass "" for this parameter the text will be displayed in the normal color for this object.

style – is the style or combination styles that should be used to display the text. For a single style by itself simply use the name of the style: “Plain”, “Bold”, “Italic” or “Underline”. If you want to combine multiple styles together you must specify the style numerically. Add up the numbers for the styles you want from the table listed below. For example, for bold italic text the style should be 3.

0 Plain
1 Bold
2 Italic
4 Underline

text – the text to be displayed


Description

This function works with Text Display Objects to control the color and style of the text on the fly. (This function only allows you to set the overall style and color of the text. If you want the text to have multiple styles and/or colors, use the richtextdisplay( function.

Here’s an example formula which displays negative Balance values in red. (Remember, this formula only works in a Text Display Object.)

textdisplay(rgb( ?(Balance<0,65535,0),0,0),0,pattern(Balance,"$#,.##"))

This example formula displays the Response field in italics if the Priority is Hot.

textdisplay("",?(Priority="Hot","italic","plain"),Response)

This slightly revised example displays the Response field in bold-italic if the Priority is Hot. It sets the style to 3 if the Priority is Hot (1=bold, 2=italic, 1+2=bold italic).

textdisplay("",?(Priority="Hot",3,0),Response)

(Advanced note: The *textdisplay(* function actually generates a special binary value that is intercepted by the Text Display Object. The binary value contains information the Text Display Object uses to select the style and color, as well as the text itself. For the super nerdy, this binary value is an encoded NSAttributedString object.)

Transitioning from Older Versions of Panorama

In Panorama 6.0 and earlier, the textdisplay( function had only two parameters: color and style. The text was included after the function, like this:

textdisplay(style,color) + text

This will no longer work. You will have to go through all of your forms and modify any formula that uses the textdisplay( function, so that the text becomes the third parameter of the function, like this:

textdisplay(style,color,text)

There is no automatic way to do this – you must manually locate and modify each formula.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now the text is included as the third parameter of the function, instead of being appended afterward.