Pseudo Drag and Drop question

Wilhelm Sanke sanke at hrz.uni-kassel.de
Thu Feb 24 05:05:18 EST 2005


On Wed, 23 Feb 2005,"Jerry Balzano" <gjbalzano at ucsd.edu> wrote:

> OK, on further review ...
>
> The maneuver suggested by David Epstein, although it seemed promising at
> first, won't work.  The only way the mouseEnter message gets triggered by
> the "receiving" object is (a) if the mouse button is up, and (b) if the
> moving control is in a layer *beneath* the receiver (else the receiver
> doesn't "see" the cursor).  The documentation on "mouseEnter" verifies all
> this.  Since (b) one would generally want to "set the layer to top" for
> any "dragged" control, and (a) one would generally have the mouse button
> down in such situations, we are double-damned.
>
> So I am back to thinking that in order to have Rev do what I want, i.e.
> have any  potential drop locations hilight as soon as the dragged object
> (or the pointer) overlaps (enters) its rectangle, I believe I need to (p)
> manage a list of potential target-controls and (q) iterate over it until I
> find one with the mouseLoc (or some such) enters the rect of it.
>
> I mainly want to know, am I right about this, that there is no easier or
> better way?
>
> Thanks,
> Jerry



On  Feb 6 I responded to a similar question by Jonathan Lynch. Maybe the 
suggestion below could be of use for you?:

You could try something like the handler below in the script of the 
dragged control:

"on mousedown
 set the layer of me to top
 grab me
 put the number of graphics into Gnumber
 repeat with i = 1 to Gnumber
   if intersect(me, grc i) then
     put the name of grc i
# or do whatever you want
   end if
 end repeat
 send "mousedown" to me in 100 milliseconds
end mousedown"

The last line does the trick.

Regards,

Wilhelm Sanke
<www.sanke.org/MetaMedia>




More information about the Use-livecode mailing list