layout-and-design-$15.lzx

<canvas height="180" width="100%">
  <class name="coloredSquare" width="20" height="20"/>

  <view name="container" bgcolor="silver" x="10" y="10">
    <simplelayout axis="x" spacing="2"/>
    <simplelayout id="yLayout" axis="y" spacing="2"/>

    <coloredSquare bgcolor="red"/>
    <coloredSquare bgcolor="red"/>
    <coloredSquare bgcolor="red"/>
    <coloredSquare bgcolor="red"/>
    <coloredSquare bgcolor="red"/>
  </view>

  <button y="150" x="10">Increase spacing of BOTH x and y layouts
    <handler name="onclick">
      
      for (var i=0; i<container.layouts.length; i++) {
          var lyt = container.layouts[i];
          lyt.setAttribute('spacing', lyt.spacing + 2);
      }
      
    </handler>
  </button>

  <button y="150" x="280">Increase spacing of y layout ONLY
    <handler name="onclick">
      yLayout.setAttribute('spacing', yLayout.spacing + 2);
    </handler>
  </button>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Classes

Named Instances