simpletext.lzx
<library>
<class name="simpleinputtext">
<attribute name="text" value="
" type="html"/>
<attribute name="textOpacity" value="1
"/>
<attribute name="bgOpacity" value="1
"/>
<attribute name="focusborderOpacity" value="1
"/>
<attribute name="blurborderOpacity" value="1
"/>
<attribute name="width" value="100
"/>
<view name="bkgnd" width="${parent.width}" height="${parent.height}" bgcolor="white" opacity="1"/>
<view name="v_border" height="1" bgcolor="black" opacity="1" width="${parent.width}"/>
<view name="h_border" width="1" y="1" bgcolor="black" opacity="1" height="${parent.height -1}"/>
<inputtext name="input" x="2" width="$once{parent.width - 4}">
<attribute name="opacity" value="parent.textOpacity
" when="once"/>
<attribute name="text" value="parent.text
" when="once"/>
<method name="handleOnFocus">
super.handleOnFocus();
this.parent.handleOnFocus();
</method>
<method name="handleOnBlur">
super.handleOnBlur();
this.parent.handleOnBlur();
</method>
<handler name="onkeyup" args="kc">
if (parent['onkeyup']) parent.onkeyup.sendEvent(kc);
</handler>
<handler name="onkeydown" args="kc">
if (parent['onkeydown']) parent.onkeydown.sendEvent(kc);
</handler>
</inputtext>
<method name="init">
if (!this.hassetheight) {
setAttribute('height', this.height + 1);
}
super.init();
</method>
<method name="setText" args="t">
this.input.setAttribute('text', t);
</method>
<method name="getText">
return this.input.text;
</method>
<handler name="onfocus">
//this.input.onfocus.sendEvent();
lz.Focus.setFocus(this.input);
</handler>
<method name="handleOnFocus">
this.v_border.setAttribute("opacity",this.focusborderOpacity);
this.h_border.setAttribute("opacity",this.focusborderOpacity);
this.bkgnd.setAttribute("opacity",1);
</method>
<method name="handleOnBlur">
this.v_border.setAttribute("opacity",this.blurborderOpacity);
this.h_border.setAttribute("opacity",this.blurborderOpacity);
this.bkgnd.setAttribute("opacity",this.bgOpacity);
</method>
<method name="applyData" args="d">
this.input.setAttribute('text', d );
</method>
<method name="updateData">
return this.input.text;
</method>
<doc>
<tag name="shortdesc"><text>
A simple input text field with basic borders.
</text></tag>
<text>
<note>
Note: Simpleinputtext is deprecated. Please use <xref linkend="lz.edittext"/> instead.
</note>
</text>
</doc>
</class>
</library>