calculator_button.lzx

<library>
    <!-- A standard calculator button -->
    <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>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Resources

Name Source Image
button_grn ./resources/new_button_green_off.png
./resources/new_button_green_over.png
./resources/new_button_green_down.png
button_blu ./resources/new_button_blue_off.png
./resources/new_button_blue_over.png
./resources/new_button_blue_down.png
button_red ./resources/new_button_red_off.png
./resources/new_button_red_over.png
./resources/new_button_red_down.png

Classes