Packages
Comm
DB
Debug
Extension
Input
Interface
Module
Token
User

Objects
bitmapwidget
databasenode
dragdata
textbasecontrol
textwidget
tokeninstance
widget
widgetcontainer
windowcontrol
windowinstance

Controls
buttoncontrol
categoryselectioncontrol
chatentry
chatwindow
databasecontrol
diecontrol
diefield
formattedtextcontrol
formattedtextfield
genericcontrol
imagecontrol
numbercontrol
numberfield
portraitselectioncontrol
scrollbarcontrol
scrollercontrol
stringcontrol
stringfield
subwindow
tokenbag
tokencontrol
tokenfield
windowlist
windowreferencecontrol
windowreferencefield

Assets and Settings
announcement
categoryselectionsettings
characterdbroot
customdie
description
desktopframe
die
diebox
distance
font
framedef
hotkeybar
icon
imageupdatefolder
imagesettings
importinfo
importruleset
includefile
panel
pollbox
portraitset
properties
replaces
script
string
template
textsettings
tokenroot
tooltip
windowclass
isEditMode
isEmpty
onGainFocus
onLoseFocus
onValueChanged
setEditMode
setFocus



Inherits windowcontrol
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+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 > 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

isEditMode

function isEditMode( )

Checks if the control is set to edit mode.

Return values

(boolean)
Returns true if the control has the edit mode flag set, false otherwise

isEmpty

function isEmpty( )

Returns whether the control contains text or is empty.

Return values

(boolean)
Whether the control is empty

onGainFocus

event function onGainFocus( )

Is called when the control gains the keyboard focus.


onLoseFocus

event function onLoseFocus( )

Is called when the control loses the keyboard focus.


onValueChanged

event function 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)


setEditMode

function setEditMode( state )

Sets the edit mode of the control.

Parameters

state(boolean)
A value of true sets the control to edit mode and a value of false disables it

setFocus

function setFocus( [state] )

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.


'Fantasy Grounds' is a trademark of SmiteWorks Ltd. All other trademarks are the property of their respective owners.
2004-2010 SmiteWorks Ltd. ALL RIGHTS RESERVED.
Privacy policy