Creation/Dev/Script/Client/GuiMLTextCtrl: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Inherits [[Creation/Dev/Script/Client/ | Inherits [[Creation/Dev/Script/Client/GuiControl|GuiControl]]. | ||
Line 61: | Line 61: | ||
onReflow(newwidth,newheight) - the size of the displayed text has been changed | onReflow(newwidth,newheight) - the size of the displayed text has been changed | ||
=Tags= | |||
The text of multi-line text controls can contain | |||
a few HTML-tags and Torque-tags, you can use both | |||
of those tag types to define colors and fonts | |||
or to include images. Currently following tags | |||
are available: | |||
<pre> | |||
HTML: | |||
<a href=url> text </a> - when the user clicks on 'text' then | |||
a web browser is opened for the specified url | |||
<body bgcolor=colorname or #rrggbb> - sets the background color | |||
<br> - line break | |||
<center> text </center> - centers the contained text | |||
<font face=fontname size=textsize color=colorname or #rrggbb> text </font> | |||
- draws text with a special font, size and color; you only | |||
need to define one of those 3 attributes | |||
<ignorelinebreaks> </ignorelinebreaks> - go into normal HTML mode where | |||
you need to insert <br> to do a linebreak | |||
<img src=filename id=integer> - an image is displayed, you | |||
can also specify a tagid if you want to get onSelectTag-events | |||
for this image | |||
<p align=left/center/right> text </p> - sets the align of the | |||
contained text | |||
<span style="width=100; height=100;" id=integer> </span> - for | |||
displaying a subpage, you can also specifiy an id for | |||
onSelectTag-events; instead of <span> you can also use <div> tags | |||
Torque: | |||
<a:url> text </a> - when the user clicks on 'text' then | |||
a web browser is opened for the specified url | |||
<bitmap:filename> - an image is displayed | |||
<color:rrggbb> - sets the color of the text (hexadecimal value) | |||
<lmargin:pixels> - sets the left margin for the text | |||
<lmargin%:percent> - sets the size of the left margin depending | |||
on the width of the whole control | |||
<linkcolor:rrggbb> - sets the color of links (the <a>-tag) | |||
<linkcolorhl:rrggbb> - sets the highlighted color, when | |||
the user moves the mouse over a link | |||
<just:left/center/right> - sets the align of the following text | |||
<rmargin:pixels> - sets the right margin for the text | |||
<rmargin%:percent> - sets the size of the right margin depending | |||
on the width of the whole control | |||
<sbreak> - line break | |||
<spush> - switches to a new style (like <font>) | |||
<spop> - switches back to the last saved style (like </font>) | |||
<tab:tab1,tab2,..> - sets the position of where tabulators should | |||
be displayed if you have text like 'Apple \t Egg \t Chicken' | |||
<tag:id> - inserts an invisible tag which can be used | |||
for the scrollToTag(id) function (beside image-tags) | |||
</pre> |
Revision as of 21:01, 19 March 2006
Inherits GuiControl.
Variables
allowcolorchars - boolean
allowedtags - string
alpha - float
deniedsound - string
disallowedtags - string
maxchars - integer
parsetags - boolean
syntaxhighlighting - boolean
text - string
wordwrap - boolean
Functions
addtext(str, bool)
getcursorline() - returns integer
getline(int) - returns string
getlinecount() - returns integer
getlines() - returns object - array of lines
gettext() - returns string
reflow()
scrolltobottom()
scrolltotag(int)
scrolltotop()
setlines(obj)
settext(str)
Events
onCursorLineChanged(line) - the cursor has been moved to another line
onSelectedTag(tagid) - an image inside the control has been clicked (<img src=imagefile id=tagid>-tag)
onURL(url) - an url has been clicked (<a href=url>-tag)
onReflow(newwidth,newheight) - the size of the displayed text has been changed
Tags
The text of multi-line text controls can contain a few HTML-tags and Torque-tags, you can use both of those tag types to define colors and fonts or to include images. Currently following tags are available:
HTML: <a href=url> text </a> - when the user clicks on 'text' then a web browser is opened for the specified url <body bgcolor=colorname or #rrggbb> - sets the background color <br> - line break <center> text </center> - centers the contained text <font face=fontname size=textsize color=colorname or #rrggbb> text </font> - draws text with a special font, size and color; you only need to define one of those 3 attributes <ignorelinebreaks> </ignorelinebreaks> - go into normal HTML mode where you need to insert <br> to do a linebreak <img src=filename id=integer> - an image is displayed, you can also specify a tagid if you want to get onSelectTag-events for this image <p align=left/center/right> text </p> - sets the align of the contained text <span style="width=100; height=100;" id=integer> </span> - for displaying a subpage, you can also specifiy an id for onSelectTag-events; instead of <span> you can also use <div> tags Torque: <a:url> text </a> - when the user clicks on 'text' then a web browser is opened for the specified url <bitmap:filename> - an image is displayed <color:rrggbb> - sets the color of the text (hexadecimal value) <lmargin:pixels> - sets the left margin for the text <lmargin%:percent> - sets the size of the left margin depending on the width of the whole control <linkcolor:rrggbb> - sets the color of links (the <a>-tag) <linkcolorhl:rrggbb> - sets the highlighted color, when the user moves the mouse over a link <just:left/center/right> - sets the align of the following text <rmargin:pixels> - sets the right margin for the text <rmargin%:percent> - sets the size of the right margin depending on the width of the whole control <sbreak> - line break <spush> - switches to a new style (like <font>) <spop> - switches back to the last saved style (like </font>) <tab:tab1,tab2,..> - sets the position of where tabulators should be displayed if you have text like 'Apple \t Egg \t Chicken' <tag:id> - inserts an invisible tag which can be used for the scrollToTag(id) function (beside image-tags)