|
|
|
P.S. : assigning to Jim for two reasons: technical review, and also for integration for this release if it's not too late.
No, that's still incorrect. For example:
<canvas debug="true"> <view > <simplelayout axis="y" spacing="10" inset="15"/> <view bgcolor="blue" x="15" height="30" width="50"> <handler name="onconstruct"> Debug.monitor(this, 'x'); Debug.monitor(this, 'y'); </handler> </view> <view bgcolor="yellow" height="30" width="50"/> <view bgcolor="green" height="30" width="50"/> </view> </canvas> Here the first (blue) view is drawn at (15, 15). The x-axis of this view is controlled by the x attribute given in the view declaration, while the y axis value is adjusted by the inset attribute of the simplelayout. Here's an example that allows you to interactively play with the options at work:
<canvas debug="true"> <view> <simplelayout axis="y" spacing="10" inset="${layout_inset.value}"/> <view bgcolor="blue" x="${first_x.value}" height="30" width="50"> </view> <view bgcolor="yellow" x="${second_x.value}" height="30" width="50"/> <view bgcolor="green" height="30" width="50"/> </view> <slider id="layout_inset" value="15"/> <slider id="first_x" value="20"/> <slider id="second_x" value="15"/> <simplelayout axis="y" spacing="5"/> </canvas> OK,
Thanks to lots of help, I think I've got it now. I'll file a new version shortly. jrs Implication that simplelayout always affects both axes removed, while first code example modified to show how both axes can be affected.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
I suggested this rewording:
<p><classname>simplelayout</classname> extends
<classname>LzLayout</classname>, and therefore it is responsible for
arranging all of the subviews for the view that it is attached to. <classname>simplelayout</classname>
affects either the <attribute>x</attribute> or <attribute>y</attribute>
value, depending on the value of the <attribute>axis</attribute> attribute. <classname>simplelayout</classname> places the first subview
at (0, 0) and then places each subsequent subview based on the width
(or height) of the previous subview, depending on which axis was
specified.</p>
Jim had a comment to that this was incorrect about the placement of first subview at 0,0, but I believe that this is true. See code below. Alternatively, you can attach an onint handler to the parent view to report the x, y coordinates of its subviews.
<canvas debug="true">
<view >
<simplelayout axis="y" spacing="10"/>
<view bgcolor="blue" y="40" height="30" width="50">
<handler name="onconstruct">
Debug.monitor(this, 'x');
Debug.monitor(this, 'y');
</handler>
</view>
<view bgcolor="blue" height="30" width="50"/>
<view bgcolor="blue" height="30" width="50"/>
</view>
</canvas>