layout-and-design-$12.lzx
<canvas width="100%">
<dataset name="ds_items">
<items>
<item description="One" src="one.jpg"/>
<item description="Two" src="two.jpg"/>
<item description="Three" src="three.jpg"/>
</items>
</dataset>
<class name="floater" height="20" bgcolor="0x93A5FF" visible="false" datapath="">
<dragstate name="dragger"/>
<text name="txt" datapath="@description" resize="true"/>
<text name="imgurl" datapath="@src" resize="true" align="right"/>
<method name="showFloater" args="xpos, ypos, itemwidth, dataNode">
myfloater.bringToFront();
this.setAttribute("x", xpos);
this.setAttribute("y", ypos);
this.setAttribute("width", itemwidth);
this.datapath.setAttribute("p", dataNode);
this.gm = new LzDelegate(this, "cancelFloater", lz.GlobalMouse, "onmouseup");
this.setAttribute("visible", true);
this.dragger.apply();
</method>
<method name="cancelFloater" args="v">
this.dragger.remove();
this.setAttribute("visible", false);
</method>
</class>
<floater id="myfloater"/>
<class name="imageRow" bgcolor="0x93A5FF" width="$once{parent.width}" height="20">
<attribute name="text" type="text"/>
<text name="txt" datapath="@description" resize="true"/>
<handler name="onmousedown">
myfloater.showFloater(this.getAttributeRelative("x", canvas),
this.getAttributeRelative("y", canvas),
this.width,
this.datapath.p);
</handler>
</class>
<view>
<view name="stage" width="400" height="300" x="20" bgcolor="0xeaeaea">
<text>Stage</text>
</view>
<view name="listOfImages" width="200" height="300" x="500" bgcolor="0xffff00" datapath="ds_items:/items">
<simplelayout axis="y" spacing="2"/>
<imageRow datapath="item"/>
</view>
<view name="trash" width="200" height="75" x="500" y="310" bgcolor="0xff0000">
<text>Trash</text>
</view>
</view>
</canvas>
Cross References
Classes
Named Instances