textdisplay(
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

- endnoshow -- resumes the output of text and graphics after it has been disabled with the noshow statement.
- endshowlater -- resumes the immediate display of text and graphics after it has been deferred with the showlater statement.
- fontcharacters( -- returns a string (text) containing all of the characters supported by the specified font.
- fontinfo( -- returns a dictionary with information about a specified font.
- hide -- temporarily disables the output of text and graphics.
- info("noshow") -- returns true if noshow is currently turned on, false if it is not.
- measuretext( -- returns the size of a string of text in a particular font and size.
- noshow -- temporarily disables the output of text and graphics.
- richtextdata( -- adjusts text so that it will display properly in rich text even if it contains a < character.
- richtextdisplay( -- works with Text Display objects to display text with multiple styles, fonts, colors and alignments.
- setbannericon -- sets the icon on the right side of the toolbar banner.
- setbannermessage -- sets the text in the toolbar banner to an arbitrary message.
- setbannerprogressbar -- displays progress in the toolbar banner.
- show -- resumes the output of text and graphics after it has been disabled and then forces Panorama to redisplay all windows in the current database.
- showcolumns -- forces Panorama to display specified fields.
- showfields -- forces Panorama to display specified fields.
- showlater -- defers the display of text and graphics until the procedure is finished.
- showline -- forces Panorama to redisplay the current record in all windows in the current database.
- showother -- forces Panorama to update some data on the screen.
- showpage -- forces Panorama to redisplay all windows in the current database.
- showrecordcounter -- forces Panorama to redisplay the record counter in all windows in the current database.
- showvariables -- forces Panorama to update the display of one or more variables on every form in the active database.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now the text is included as the third parameter of the function, instead of being appended afterward.