This looks like a good suggestion to me. Filing a bug at http://
www.openlaszlo.org/jira/secure/Dashboard.jspa under openlaszlo is one
way to make sure it gets done.
On 28 Dec 2005, at 14:29, Garth Smedley wrote:
Hi All,
When using a wrapping layout, once you get a high row, every row
that follows is also high. In the example below the 2nd item in 3rd
row, "GI Problems" , wraps making a new height which gets used by
the following rows.
<moz-screenshot-3.jpg>
I think it would be better to reset the max height for each row
which would make the example look like this:
<moz-screenshot-2.jpg>
Here is a fix for the update method of wrappinglayout which does this:
<method name="update">
<![CDATA[
if ( this.locked ) return;
var l = this.subviews.length;
var limit = this.immediateparent[this.sizeAxis];
// position along this.axis
var pos = this[this.axis + 'inset'];
// position along this.otherAxis
var otherpos = this[this.otherAxis + 'inset'];
var maxdimension = 0;
var space = this[this.axis + 'spacing']; // spacing in
axis dimension
var otherspace = this[this.otherAxis + 'spacing']; //
spacing in other axis dimension
for(var i=0; i < l; i++) {
var s = this.subviews[i];
s.animate(this.axis, pos, this.duration,false);
s.animate(this.otherAxis, otherpos, this.duration,false);
pos += s[this.sizeAxis];
if ( i < (l - 1)) {
pos += space;
maxdimension = Math.max(maxdimension,s
[this.otherSizeAxis]);
if (( pos > limit) ||
(pos + this.subviews[i+1][this.sizeAxis] >
limit)) {
pos = this[this.axis + 'inset'];
otherpos += maxdimension + otherspace;
maxdimension = 0; // Reset the height/width
after every row/column
}
}
}
]]>
</method>
Here is a snippet of the code used for the example
<hbox width="${parent.width -
10 }" >
<wrappinglayout axis="x" />
<view width="${parent.width/3 -
10}" datapath="comorbidities/comorbidity">
<text multiline="true"
width="${parent.width}" datapath="@label" />
</view>
</hbox>
Regards,
Garth
<moz-screenshot-3.jpg>
<moz-screenshot-2.jpg>
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev