Description
A view which contains the text area for a rich text editor. Combine with a
richtexttoolbar to make an actual editor.
Superclass Chain
richtexteditarea
Details
Properties (18)
-
currentformat
-
<attribute name="currentformat" />
public var currentformat;
The current format in which text should be added, and which the
toolbar should reflect. Everyone interested in the current format
should look at this attribute to see what it is.
-
defaultfontcolor
-
<attribute name="defaultfontcolor" value="0x000000" />
public var defaultfontcolor;
-
defaultfontname
-
<attribute name="defaultfontname" type="string" value="Verdana" />
public var defaultfontname : String;
-
defaultfontsize
-
<attribute name="defaultfontsize" type="number" value="11" />
public var defaultfontsize : Number;
-
editortype
-
<attribute name="editortype" type="string" value="flash-html" />
public var editortype : String;
Attribute indicating the type of HTML content produced by editor.
-
_esel
-
<attribute name="_esel" value="0" />
-
_fieldhasfocus
-
<attribute name="_fieldhasfocus" value="false" />
private var _fieldhasfocus;
True if the input text associated with this RTE has focus.
-
_ignorenextfocus
-
<attribute name="_ignorenextfocus" value="false" />
private var _ignorenextfocus;
True if the next onfocus should be ignored.
-
indentsize
-
<attribute name="indentsize" value="35" />
The size in points of an indent
-
insertionpoint
-
<attribute name="insertionpoint" value="0" />
public var insertionpoint;
The current index of the insertion point. Should be -1 if there's
no insertion point.
-
isHTML
-
<attribute name="isHTML" value="false" />
Indicates whether there's formatting on the text contained by this
editor.
-
linkpanel
-
<attribute name="linkpanel" />
Reference to the hyperlink creation dialog.
This attribute should be set by users, if there is
an associated link panel
-
_mousedownorigin
-
<attribute name="_mousedownorigin" value="null" />
private var _mousedownorigin;
the component on which a mousedown originated, if the mouse is
currently down
-
_shouldresettoolbar
-
<attribute name="_shouldresettoolbar" value="true" />
private var _shouldresettoolbar;
Whether to inform toolbar of changes in the caret position.
-
_ssel
-
<attribute name="_ssel" value="0" />
Start in selection region.
-
startformat
-
<attribute name="startformat" />
-
toolbar
-
<attribute name="toolbar" />
Reference to the toolbar associated with this editor.
For the toolbar to show the correct format when the insertion
point moves, this attribute must be set by users.
-
toolbarplacement
-
<attribute name="toolbarplacement" value="null" />
public var toolbarplacement;
The placement for the toolbar in the richtexteditor.
Methods (18)
-
_caretmove()
-
<method name="_caretmove" />
private function _caretmove();
Called whenever the caret (aka insertion point) moves in this text field.
// see [BUG ZIM-1268]
-
_containsOnlyWhitespace()
-
<method name="_containsOnlyWhitespace" />
private function _containsOnlyWhitespace() : boolean;
Returns whether the string passed in is entirely whitespace
-
_containsView()
-
<method name="_containsView" args="v" />
private function _containsView(v) : string;
Returns whether the passed in node is a child of this view or
of the toolbar.
-
delegateInitSelection()
-
<method name="delegateInitSelection" />
public function delegateInitSelection();
Initialize the selection region on focus event
-
delegateRestoreSelection()
-
<method name="delegateRestoreSelection" />
public function delegateRestoreSelection();
Restore the selection region, but do it in the next "frame." This is
necessary because Flash is frame-based and can't handle certain selection
changes in a single "frame."
-
_focussel()
-
<method name="_focussel" />
private function _focussel();
Called by a delegate after we get focus, to get rid of the default
select of everything, and instead just move the insertion point to the end
and make sure the insertion point is formatted properly.
-
_formatAtInsertion()
-
<method name="_formatAtInsertion" args="ip" />
private function _formatAtInsertion(ip : Number);
Helper method for applyFormat() to apply format at insertion point.
Only do this if the message is html already.
-
_handleLostMouseDown()
-
<method name="_handleLostMouseDown" />
private function _handleLostMouseDown();
Handle the case where a mouse drag began on the RTE but the mouse up
was not on the RTE.
-
init()
-
-
reset()
-
Reset the values of the richtexteditor.
-
_resetFormatToDefaults()
-
<method name="_resetFormatToDefaults" args="fmt" />
private function _resetFormatToDefaults(fmt : textformat);
Helper method to set an textformat to its default for this
richtexteditor.
-
_restoreSelection()
-
<method name="_restoreSelection" />
private function _restoreSelection();
Restore last selection region.
Note: this must be called from a delegate in an idle event
after* flash completes the "frame" in which the selection or focus
changed.
-
saveSelectionRegion()
-
<method name="saveSelectionRegion" />
public function saveSelectionRegion();
-
setCurrentFormat()
-
<method name="setCurrentFormat" args="fmt, inCaretMove" />
public function setCurrentFormat(fmt : textformat, inCaretMove : boolean);
Change the format of the selection by attributes contained in TextFormat object.
-
setFormatAttribute()
-
<method name="setFormatAttribute" args="attr, val" />
public function setFormatAttribute(attr : string, val : string);
Change the format of the selection by just one attribute. This
allows the selection to keep non-uniform formats on attributes which
are not being adjusted. That is: select "pear, cherry", where pear is green
and cherry is red. Change the font to helvetica using the
combo box. Now it's all helvetica, but pear is still green and
cherry is still red.
If no text is currently selected, format the insertion point.
This handles character formatting only. Not paragraph formatting.
See setParagraphAttribute.
-
setLinkPanel()
-
<method name="setLinkPanel" args="lp" />
public function setLinkPanel(lp);
Hook this editor up to a link panel, so that the
linkpanel will be hidden when the editor is reset
-
setSelection()
-
<method name="setSelection" args="ns, ne" />
public function setSelection(ns, ne);
-
setToolbar()
-
<method name="setToolbar" args="tb" />
public function setToolbar(tb);
Hook this editor up to a toolbar, so that the toolbar's ui
will stay synchronized with the format at the insertion point
of this editor.
LZX Synopsis
<class name="
lz.richtexteditarea">
<attribute name="
editortype
" type="
string" value="
flash-html" />
<attribute name="
_esel
" value="
0" />
<attribute name="
isHTML
" value="
false" />
<attribute name="
_ssel
" value="
0" />
<method name="
reset
" />
</class>
JavaScript Synopsis
public
lz.richtexteditarea {
prototype private function
init
();
prototype public function
reset
();
prototype public function
setCurrentFormat
(
fmt : textformat,
inCaretMove : boolean);
}