formattedtextcontrol

Inherits

windowcontrol

Inherited By

formattedtextfield

Context

windowinstance

A formattedtextcontrol is a window control that contains formatted text and is not bound to a database node. (See also formattedtextfield)

The formatted text is always displayed in a multi-line format.


Shortcut Keys Supported

  • CTRL+1 - Change paragraph containing cursor into normal text block

  • CTRL+2 - Change paragraph containing cursor into header text block

  • CTRL+3 - Change paragraph containing cursor into chat frame text block

  • CTRL+4 - Change paragraph containing cursor into list block

  • CTRL+5 - Change paragraph containing cursor into link list block

  • CTRL+6 - Change paragraph containing cursor into new table

  • CTRL+B - Bold selected text.

  • CTRL+I - Italicize selected text.

  • CTRL+U - Underline selected text.

  • CTRL+A - Select all text

  • CTRL+C - Copy selected text to the clipboard.

  • CTRL+J - Join paragraph containing cursor with the following line.

  • CTRL+V - Paste text on the clipboard into the control.

  • CTRL+X - Copy selected text to the clipboard, and delete the selection.

  • CTRL+Z - Undo last change.

  • CTRL+TAB - Insert new cell in table, or assign speaker to chat text.

  • CTRL+PLUS - Increase column width of table cell by one.

  • CTRL+MINUS - Decrease column width of tabel cell by one.


Internal Representation

Internally, the formattedtextcontrol uses the following XML tags to represent formatting embedded within the text:

  • p - Indicates paragraph using normal formatting.

  • h - Indicates a paragraph using header formatting.

  • frame - Indicates a paragraph using chat frame formatting.

  • frameid - Used within the frame tag, immediately following the frame open tag. Indicates the speaker for chat text.

  • list - Indicates a list.

  • li - Used within the list tag. Supports a numerical indent attribute. Indicates an entry in the list, and contains the text to display for this list item.

  • linklist - Indicates a list of shortcut links. (similar to windowreferencecontrols)

  • link - Used within the linklist tag. Supports a numerical indent attribute. Indicates an entry in the link text, and contains the text to display next to the link.

  • b - Used within p, li or link tags. Indicates that the text within the tags should be bold.

  • i - Used within p, li or link tags. Indicates that the text within the tags should be italicized.

  • u - Used within p, li or link tags. Indicates that the text within the tags should be underlined.

  • table - Indicates a table. Tables can not be created or edited, only accessed via modules created outside of FG.

  • tr - Used within the table tag. Indicates a table row.

  • td - Used within the tr tag. Supports a colspan attribute, similar to HTML formatting. Indicates a table cell, and the text to display within the cell.


Definition

<formattedtextcontrol name="..." > <font > <normal > ... </normal> <bold > ... </bold> <italic > ... </italic> <bolditalic > ... </bolditalic> <title > ... </title> </font> <icon > <link > ... </link> <emptylink > ... </emptylink> <chat > ... </chat> </icon> <linkicon > <link > ... </link> <emptylink > ... </emptylink> </linkicon> <footer > ... </footer> <selectioncolor > ... </selectioncolor> <empty > <text > ... </text> <textres > ... </textres> <hidereadonly > ... </hidereadonly> </empty> </formattedtextcontrol>

<formattedtextcontrol name="..." >

 

<font >

The names of the fonts to use when displaying the formatted text

<normal > ... </normal>

The font to use for normal text.

<bold > ... </bold>

The font to use for bolded text.

<italic > ... </italic>

The font to use for italicized text.

<bolditalic > ... </bolditalic>

The font to use for bolded, italicized text.

<title > ... </title>

The font to use for header text.

</font>

 

<icon >

The names of the icon resources to use in this control

<link > ... </link>

The icon to use when link data exists.

<emptylink > ... </emptylink>

The icon to use when link data does not exist.

<chat > ... </chat>

The icon to use as a trigger for spoken dialogue text.

</icon>

 

<linkicon >

The names of the icons to use when displaying links.

<link > ... </link>

The icon to use when link data exists.

<emptylink > ... </emptylink>

The icon to use when link data does not exist.

</linkicon>

 

<footer > ... </footer>

The name of the icon to display beneath the formatted text.

<selectioncolor > ... </selectioncolor>

The color to use for text selection, in the form '#aarrggbb'. If alpha is zero or not defined, FF is assumed.

<empty >

The text to display when the underlying formattedtext value is empty. If no child tags or attributes defined, the enclosed text will be used.

<text > ... </text>

Text to display when control is empty.

<textres > ... </textres>

String resource to display when control is empty.

<hidereadonly > ... </hidereadonly>

Attribute. If exists, the empty text is not displayed when control set to read only status.

</empty>

 

</formattedtextcontrol>

 

Interface

getText

function getText()

Returns a simplified textual representation of the value contained in the formatted text control.

Return values

(string)
Returns the simplified text value.

getValue

function getValue()

Returns a XML representation of the value contained in the formatted text control.

Return values

(string)
Returns the XML text value.

onGainFocus

Is called when the control gains the keyboard focus.

onLoseFocus

Is called when the control loses the keyboard focus.

onValueChanged

Is called when the underlying value referenced by the control changes. This may result from changes outside of direct editing by this control. (i.e. via ruleset script or another control accessing same database value)

setFocus

This function requests the framework to either set or reset the keyboard focus to this control.

Parameters

state   (boolean)   [optional]
A value of true sets the focus to this control, a false value resets the focus. When the parameter is omitted (synonymous to passing a nil value), the value is treated as true.

setValue

Returns a XML representation of the value contained in the formatted text control.

Parameters

value   (string)
The new XML value for the formatted text control.