<simpleboundslayout>

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

JavaScript: simpleboundslayout

Extends Layout

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 1. Comparing simpleboundslayout with simplelayout
<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 Usage Type (Tag) Type (JS) Default Category
axis Tag & JS string String y setter
 

The axis in which this layout operates, 'x' or 'y'. Default value is 'y'


spacing Tag & JS expression any 0 setter
 

A pixel amount to use between each view in the layout. Default value is 0



Attributes inherited from Layout

defaultplacement, delegates, locked, subviews, updateDelegate, view.layouts

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes


Methods

setAxis()
simpleboundslayout.setAxis(a)

setter for the axis attribute. The default value is 'y'

Parameters
Name Type Desc
a string 'x' oy 'y'


update()
simpleboundslayout.update()

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



Methods inherited from LzLayout

addSubview, ignore, lock, releaseLayout, removeSubview, reset, setLayoutOrder, swapSubviewOrder, unlock

Methods inherited from LzNode

animate, applyConstraint, applyData, childOf, completeInstantiation, construct, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, init, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption


Events

Events inherited from LzNode

onconstruct, ondata, oninit