calculator_button.lzx
<library>
<resource name="button_grn">
<frame src="./resources/new_button_green_off.png"/>
<frame src="./resources/new_button_green_over.png"/>
<frame src="./resources/new_button_green_down.png"/>
</resource>
<resource name="button_blu">
<frame src="./resources/new_button_blue_off.png"/>
<frame src="./resources/new_button_blue_over.png"/>
<frame src="./resources/new_button_blue_down.png"/>
</resource>
<resource name="button_red">
<frame src="./resources/new_button_red_off.png"/>
<frame src="./resources/new_button_red_over.png"/>
<frame src="./resources/new_button_red_down.png"/>
</resource>
<class name="calcButton" resource="button_blu" clickable="true" onclick="display.inputDigit( this );" oninit="this.initButton()" extends="basebutton">
<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" width="0">
<handler name="ontext">
this.setAttribute( 'width', this.getTextWidth() + 5 );
</handler>
</text>
</class>
</library>
Cross References
Resources
Classes