Description
This component provides the look and feel for user editable text, data
binding, and focus events.
Details
Properties (14)
-
fgcolor
-
<attribute name="fgcolor" />
Setting the fgcolor of text has the unfortunate effect of setting
the hilite color as well, so it is disabled here.
-
_fgcolor
-
<attribute name="_fgcolor" value="0" />
-
_field
-
<attribute name="_field" value="null" />
Reference to _internalinputtext. This is set by the
_internalinputtext during its initialization. _internalinputtext
is not defined by baseeditext and should be declared by subclasses
for proper visual placement.
-
fontsize
-
<attribute name="fontsize" value="13" />
Font size of the text. Default is 13.
-
height
-
<attribute name="height" value="20" />
The height of the edit text box, default: 20.
-
_initialtext
-
<attribute name="_initialtext" type="string" value="" />
private var _initialtext : String;
This should be null if not set during early init.
-
_initialtexty
-
<attribute name="_initialtexty" value="false" />
private var _initialtexty;
Boolean to see if baseedittext needs to place y position for text
during init.
-
maxlength
-
<attribute name="maxlength" type="number" value="null" />
public var maxlength : Number;
The maximum number of chars that can be entered. Default is
unlimited.
-
multiline
-
<attribute name="multiline" value="false" />
Set to true for multiple lines. Default is false.
-
password
-
<attribute name="password" value="false" />
public final var password;
Set to true for a password field. Text will appear as ****.
This attribute cannot be changed at runtime.
Default: false.
-
pattern
-
<attribute name="pattern" type="string" value="$once{null}" />
public var pattern : String;
An expression to restrict the set of characters that are allowed
to be entered. For example, [0-9]*, [012]*, [a-zA-Z]*,
[0-9A-Z]*. You can restrict the number of characters using
maxlength. Default is any character.
-
text
-
<attribute name="text" type="html" />
public var text : lz.html;
The text that appears in the component. Text and value are the
same.
-
value
-
<attribute name="value" value="null" />
The text that appears in the component. Text and value are the
same.
-
width
-
<attribute name="width" value="106" />
The width of the edit text box, default: 106.
Methods (16)
-
_applystyle()
-
<method name="_applystyle" args="s" />
private function _applystyle(s);
-
clearText()
-
<method name="clearText" args="isinitvalue" />
public function clearText(isinitvalue : Boolean);
-
getSelectionPosition()
-
<method name="getSelectionPosition" />
public function getSelectionPosition();
Get the current selection position.
-
getSelectionSize()
-
<method name="getSelectionSize" />
public function getSelectionSize();
Get the current selection size.
-
getText()
-
<method name="getText" />
public function getText() : String;
Returns the text displayed in this component. The same as calling
getValue(false).
-
getValue()
-
<method name="getValue" />
public function getValue() : String;
Returns string displayed in this component. Also see getText().
-
init()
-
-
_placeTextY()
-
<method name="_placeTextY" />
private function _placeTextY();
If multiline, places text two pixels from top, else it calculates
the middle point for the textbox.
-
setHeight()
-
<method name="setHeight" args="h" />
private function setHeight(h);
Set baseedittext height and correctly place text for
internalinputfield using _placeTextY().
-
setMaxlength()
-
<method name="setMaxlength" args="n" />
public function setMaxlength(n);
-
setMultiline()
-
<method name="setMultiline" args="ml" />
private function setMultiline(ml);
Set edittext's and _field's multiline attributes. Will affect text
placement if multiline attribute changes.
-
setPattern()
-
<method name="setPattern" args="r" />
public function setPattern(r);
-
setSelection()
-
<method name="setSelection" args="start, end" />
public function setSelection(start : Number, end : Number);
Positions the text selection within the text field. If this object
does not already have the focus, this has the ancillary effect of
giving it the focus.
-
setText()
-
<method name="setText" args="t, isinitvalue" />
public function setText(t : String, isinitvalue : Boolean);
Set text. Wraps setValue().
-
setValue()
-
<method name="setValue" args="value, isinitvalue, _ignorecalldown" />
public function setValue(value : String, isinitvalue : Boolean, _ignorecalldown);
Set the value (text) of baseedittext.
-
_showEnabled()
-
<method name="_showEnabled" />
private function _showEnabled();
Events (1)
-
onvalue
-
<attribute name="onvalue" />
Sent when the value of the text changes.
LZX Synopsis
<class name="
lz.baseedittext" extends="
lz.baseformitem
">
<attribute name="
_fgcolor
" value="
0" />
<attribute name="
_field
" value="
null" />
<attribute name="
fontsize
" value="
13" />
<attribute name="
height
" value="
20" />
<attribute name="
maxlength
" type="
number" value="
null" />
<attribute name="
multiline
" value="
false" />
<attribute name="
password
" value="
false" />
<attribute name="
pattern
" type="
string" value="
$once{null}" />
<attribute name="
text
" type="
html" />
<attribute name="
value
" value="
null" />
<attribute name="
width
" value="
106" />
<method name="
clearText
" args="
isinitvalue" />
<method name="
setText
" args="
t,
isinitvalue" />
<method name="
setValue
" args="
value,
isinitvalue,
_ignorecalldown" />
</class>
JavaScript Synopsis
public
lz.baseedittext extends
lz.baseformitem
{
public var
text
:
lz.html;
prototype public function
clearText
(
isinitvalue : Boolean);
prototype public function
getText
() :
String;
prototype public function
getValue
() :
String;
prototype private function
init
();
prototype public function
setSelection
(
start : Number,
end : Number);
prototype public function
setText
(
t : String,
isinitvalue : Boolean);
prototype public function
setValue
(
value : String,
isinitvalue : Boolean,
_ignorecalldown);
}