calculator-$9.lzx

<canvas width="100%" height="100">
    <!-- Uncomment to include fonts for SWF -->
    <!-- fonts -->
    <!-- 
    <font src="helmetbi.ttf" name="obliqueText" />

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

Cross References

Resources

Name Source Image
button_blu resources/button_blue.gif
button_red resources/button_red.gif
button_green resources/button_green.gif

Classes