Drag command--does this seem right?

dunbarx at aol.com dunbarx at aol.com
Wed Dec 21 16:02:02 EST 2016


Devin.


I don't see it that way. The "mouseMove" message is sent continuously and "me" is always going to be the card, since that is where the handler lives. Try moving the handler to the stack script. You will need to modify it a little:



on mouseMove
   put ""
   wait 1
   put me
   --if the target <> me then
      if the optionkey is down then grab the target
   --end if
end mouseMove


because the "target" is not really applicable from there. but "me" still is.


Craig Newman



-----Original Message-----
From: Devin Asay <devin_asay at byu.edu>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Wed, Dec 21, 2016 3:44 pm
Subject: Re: Drag command--does this seem right?

Actually, what I meant to say is:

On Dec 21, 2016, at 1:38 PM, Devin Asay <devin_asay at byu.edu<mailto:devin_asay at byu.edu>> wrote:

Hi all,

I just accidentally discovered something curious:

Given a card with a any control object on it, and the following two handlers in the card script, the outcome is identical:

Given a card with any control object on it, and either of the following two handlers in the card script, the outcome is identical:

on mouseDown
 if the target <> me then
    grab the target
 end if
end mouseDown

on mouseMove
 if the target <> me then
    grab the target
 end if
end mouseMove

In other words, when you click down on an object that isn’t the card itself, the object follows the mouse until you release it.

This is not what I would expect. I would expect that the mouseDown handler works as I described, but that the mouseMove handler would grab a control as you moved over it and follow it around. I’m not saying that’s a desirable thing, just what I would expect.

The Dictionary says,”Use the grab command within a mouseDown handler to drag an object around the stack window without selecting it.” That implies that grab was only intended to work on mouseDown. When grab happens in a mouseMove handler it seems to generate an implicit mouseDown.

So my question is, is this a bug, a quirk, or a feature? If it’s a bug, I file a report.

Devin


Devin Asay
Director
Office of Digital Humanities
Brigham Young University

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Devin Asay
Director
Office of Digital Humanities
Brigham Young University

_______________________________________________use-livecode mailing listuse-livecode at lists.runrev.comPlease visit this url to subscribe, unsubscribe and manage your subscription preferences:http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the Use-livecode mailing list