calculator-$9.lzx
<canvas width="100%" height="100">
<resource name="button_blu" src="resources/button_blue.gif"/>
<resource name="button_red" src="resources/button_red.gif"/>
<resource name="button_green" src="resources/button_green.gif"/>
<class name="calcButton" resource="button_blu" clickable="true" onclick="/*display.inputDigit(this);*/" oninit="this.initButton()">
<attribute name="buttLabel" type="string"/>
<attribute name="labelX" type="number" value="11
"/>
<method name="initButton">
this.buttonText.setAttribute('x',
this.labelX);
this.buttonText.setAttribute('text', this.buttLabel);
</method>
<text name="buttonText" font="obliqueText" fontsize="25" fgcolor="#ffffff" x="13" valign="middle">
<handler name="ontext">
this.setAttribute('width', this.getTextWidth() + 5);
</handler>
</text>
</class>
<simplelayout axis="x" spacing="5"/>
<calcButton buttLabel="0"/>
<calcButton buttLabel="1" resource="button_red"/>
<calcButton buttLabel="+/-" resource="button_green" labelX="0"/>
</canvas>
Cross References
Resources
Classes