A utility class which simplifies tracking of cursor movement across a set of views while in a mousedown state. This involves creating a trackgroup with a unique ID and the registering of any views associated with that trackgroup.
basetrackgroup
handles this
automatically. It creates the unique trackgroup name and automatically
registers its subviews to be tracked by the group. A developer needs
to create the methods within the subviews to respond to the set of
mousetrack events.
The example below displays four colored rectangles within a
basetrackgroup
layed out vertically. The
rectangles respond to the various moustrack events by changing their
background colors. Try pressing the mouse down on one square, and
dragging across the other squares.
<canvas height="200"> <include href="/base/basetrackgroup.lzx"/> <class name="testview" bgcolor="red" width="100%" height="30" clickable="true"> <handler name="onmousetrackover"> this.setHilite(true); </handler> <handler name="onmousetrackout"> this.setHilite(false); </handler> <handler name="onmousetrackup"> this.setSelect(true); </handler> <method name="setHilite" args="ishilite"> if (ishilite ) this.setBGColor(0x00FF00); else this.setBGColor(0xFF0000) </method> <method name="setSelect" args="isSelect"> if (isSelect) this.setBGColor(0x0000FF); else this.setBGColor(0xFF0000) </method> </class> <basetrackgroup x="20" y="20" width="100" height="200"> <testview name="v1"/> <testview name="v2"/> <testview name="v3"/> <testview name="v4"/> <simplelayout axis="y" spacing="10"/> </basetrackgroup> </canvas>
Copyright © 2002-2007 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.