PDA

View Full Version : Formatted text question.



drahkar
May 14th, 2011, 13:10
My Library reference code has this element in it:



<formattedtextfield name="text">
<bounds>25,44,-25,-14</bounds>
<font>
<normal>chatfont</normal>
<bold>narratorfont</bold>
<italic>chatitalicfont</italic>
<bolditalic>chatbolditalicfont</bolditalic>
<title>sheetlabel</title>
</font>
<linkicon>
<link>button_openwindow</link>
<emptylink>button_emptytarget</emptylink>
</linkicon>
<footer>footer_wide</footer>
<selectioncolor>#FFD296</selectioncolor>
</formattedtextfield>


It doesn't seem to be a template as it doesn't exist as a defined template anywhere, but for the life of me I can't find details of the element as a element anywhere. Does anyone have any insight on this one? I'm trying to gain a better understanding of the underlying methods of formatted text.

Zeus
May 14th, 2011, 13:27
I ironically queried the status of this very same topic, this morning with JPG. I am awaiting his response.

<formattedtextfield>'s are complex data types available as part of the native API (hence why you cannot find any definition reference to it in ruleset files. However due to the complexity of the type, no get/set API methods exist (that I am aware of) that allow for any manipulation (at a programatic level). AFAIK the only way to edit the contents of a <formattedtextfield> is to edit from within FGII using the standard GUI interface controls or to edit the contents through the XML directly.

Having said that basic online documentation appears to be missing for formattedtextfields however you can find some information over at the FGWiki (https://oberoten.dyndns.org/fgwiki/index.php/Formatted_Text).

AFAIK <formattedtextfield> inherits some of the generic <windowcontrol> API methods. e.g. setEnabled()

drahkar
May 14th, 2011, 13:42
Thanks Doc. Guess I'll just have to play with it for now. :)

Moon Wizard
May 14th, 2011, 19:13
It appears that the formattedtextfield object was added by the original developers under the radar. (i.e. they used it to do some fancier formatting, but did not publish to general community)

Of course, over time, a lot of the ruleset and module developers found this field type, and began using it rather extensively.

Here's a quick summary of attributes and methods supported:


<font>
<normal>
<bold>
<italic>
<bolditalic>
<title> used for header paragraph types
<linkicon>
<link> icon to use for link list entry that has value
<emptylink> icon to use for link list entry which has no value
<footer> image to display at the bottom of a formatted text field
<selectioncolor> color to use when selecting text
<empty> string to show when the field contains no data

isEmpty() returns boolean value of whether field is empty


I will be adding it to the developer documentation for v2.8, along with a raft of other changes.

Thanks,
JPG