<simpleboundslayout>
Arranges a set of views along an 'x' or 'y' axis with respect to the bounding rect of the views

JavaScript: lz.simpleboundslayout
extends <layout> » <node> » lz.Eventable »

Views have a bounding rectangle that can be different than the rectangle that is defined by their position, width and height. simpleboundslayout uses that bounding rectangle to lay out a set of views along an x or y axis, similar to <simplelayout> that uses a views position and its width or height. The example below shows the difference when using simpleboundslayout vs. a simplelayout for a set of three views.

Example 73. Example of simpleboundslayout

<canvas height="100">
  <include href="utils/layouts/simpleboundslayout.lzx"/>
  <view bgcolor="0x8A8A8A" x="10" y="10">
    <view width="60" height="60" bgcolor="teal"/>       
    <view width="60" height="60" bgcolor="blue" rotation="45"/> 
    <view width="60" height="60" bgcolor="teal"/>           
    <simpleboundslayout axis="x"/> 
  </view>
  <view bgcolor="0x8A8A8A" x="250" y="10">
    <view width="60" height="60" bgcolor="teal"/>       
    <view width="60" height="60" bgcolor="blue" rotation="45"/> 
    <view width="60" height="60" bgcolor="teal"/>           
    <simplelayout axis="x"/> 
  </view>
</canvas>

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
axis string String y read/write
  The axis in which this layout operates, 'x' or 'y'.
spacing expression any 0 read/write
  A pixel amount to use between each view in the layout.

Attributes inherited from <layout>

locked, subviews, updateDelegate

Methods

setAxis()
simpleboundslayout.setAxis(a : string);
setter for the axis attribute. The default value is 'y'
Parameter Name Type Description
a string 'x' oy 'y'

update()
simpleboundslayout.update(v);
This method is usually called automatically when any of the views controlled by the layout change their size in the layout axis, or their visibility. However it can be called directly to force the layout to update
Parameter Name Type Description
v    

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy