PDA

View Full Version : tree gets clipped!


counterpoke
07-27-2004, 02:36 PM
When this page loads up, everything looks fine and everything, yet when you expand the tree, the last 3 digits "04" in "2004" gets clipped by the scrollbar. I was thinking that the "clip" parameter might prevent this, but putting it on "true" or "false" doesn't seemed to help when I put it on the tree, the view, the scrollbars... I would like it so that you can see the whole date "2004" without it being clipped. Can anyone help?

-Dexter

antun
07-27-2004, 02:46 PM
I can't run it without the data, but if you want to prevent clipping by a scrollbar, the thing to do is widen the view that houses both the scrollbar and the tree. In your case, it's as wide as the canvas. You could try putting in a horizontal scrollbar too...

The clip attribute determines whether a view should clip its subviews or not; it won't help you here.

-Antun

counterpoke
07-27-2004, 02:59 PM
The thing is that the width of the tree varies so I cant just arbitrary set the width of the view, that's why I put the vertical and horizontal scrollbars... Here's the data file.

-Dexter

ps thanks for replying so fast :)

antun
07-28-2004, 09:23 AM
I see what you mean. This appears to be a bug in that the horizontal scrollbar is not accomodating the vertical one. I've filed it.

In the meantime, here's a workaround - wrap the tree in a view that constrains its width to the width of the tree plus a little bit more:


<view y="100" width="105" height="400" clip="true" bgcolor="0x7CA17F">
<view width="${treeroot.width+20}">
<tree name="treeroot" y="10" datapath="sample:/myXML[1]" text="Notes">
<tree datapath="*" text="$path{'creationDate'}" isleaf="$path{'type'}" clip="true">
<method event="onclick">
ms.ds.datapath.setPointer(this.datapath.p);
</method>
</tree>
</tree>
</view>
<scrollbar />
<scrollbar axis="x" />
</view>


Take care,

Antun

counterpoke
07-29-2004, 07:20 PM
hey thanks again antun! Your work around works very well and I'll probably use that. I feel so good for finding a bug in laszlo... heheeheheh I'm probably gonna brag to everyone I know.

Thanks again!

-Dexter

antun
07-30-2004, 02:23 PM
If you want I'll send you a Laszlo T-shirt for finding it; just use the PM feature to send me your address and I'll pop one in the post to you.

-Antun

Originally posted by counterpoke
I feel so good for finding a bug in laszlo...

jimhsu
02-23-2005, 04:51 PM
Sorry to churn up an old thread, but this one seemed very relevant to a bug I recently discovered.

The max length of tree node strings seems related to the width of the canvas. See test case below...

(do I get a t-shirt?? :)

<canvas title="Tree Example" bgcolor="#eaeaea" width="83" height="550">

<include href="lz/tree.lzx"/>

<dataset name="mydata">
<basket name="basketArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidus" isopen="true">
<product name="fruitsArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidus" isopen="true">
<apples name="applesArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidusArdipithecus ramidus" isopen="true">
<type name="red delicious apple" isleaf="true" url="http://www.nyapplecountry.com/reddelicious.htm"/>
<type name="fuji apple" isleaf="true" url="http://www.nyapplecountry.com/fuji.htm"/>
<type name="braeburn apple" isleaf="true" url="http://www.nyapplecountry.com/braeburn.htm"/>
<type name="honey crisp" isleaf="true" url="http://www.nyapplecountry.com/honey.htm" isopen="true"/>
</apples>
</product>
</basket>
</dataset>

<window x="0" y="0" width="200" height="400">
<tree style="goldcolors" datapath="mydata:/basket" open="$path{'@isopen'}" text="$path{'@name'}" multiselect="true">
<tree id="test" style="goldcolors" datapath="*" text="$path{'@name'}" isleaf="$path{'@isleaf'}">
</tree>
</tree>
<vscrollbar/>
<hscrollbar/>
</window>

</canvas>

objectid
04-01-2005, 05:36 AM
Still this bug has not been solved completely. The scrollbars overlay part of the underlying tree view. The area the scrollbar controls of the view is larger then the scrollbar itself. So part of the tree view disappears under the scrollbars without being able to scroll the obscured part into the visible area.

Look at the sample_test, the text of the tree nodes disappear under the vertical scrollbar. I'm amazed that after almost 9 month after the first post of counterpoke, the problem is still not fixed. Nobody using scrollbars in Laszlo?

counterpoke
04-01-2005, 12:04 PM
Well the work around that Antun suggested works, so i don't really care about the bug anymore...