Drag and Drop

André Bisseret andre.bisseret at wanadoo.fr
Fri May 10 04:36:50 CDT 2013


Bonjour Ray,

Recently I had a similar problem but while dragging from one locked field to an unlocked field on the same card.

The dragdrop handler did not work until I "pass dragdrop" at the end of the dragdrop handler.

Not sure that will help in your case!

Best regards

André

Le 10 mai 2013 à 02:03, Ray Horsley a écrit :

> Many thanks to you all who responded to this thread I started earlier today.  Unfortunately I still haven't resolved this issue so any other thought are appreciated.  Here's a few responses to some of the ideas which were presented:
> 
>   -  The mouseDown and mouseStillDown unfortunately don't work since I'm dragging a file from the desktop to a Livecode stack (not beginning the drag action in Livecode) although that's kind of cool to know that mouseMove messages get sent during a grab.  I didn't know that.
> 
>   -  Doing anything with "on dragStart" also does not work since I'm starting the drag operation outside of Livecode (on a desktop file)
> 
>   -  Setting the dragAction to "copy" instead of "move" works better in my case since it adds a plus sign to the cursor (when it works) but still does not solve the intermittent failure of Livecode to accept the drop consistently.
> 
>   -  Thanks for the link to the article "Pinning Drag-and-Drop to the Mat" but I had actually read through it yesterday when I began wrestling with this.  It, too, does not address dragging files from the desktop into Livecode.
> 
> At the end of the day I'm wondering if this should be reported as a bug.  It seems like something is getting hooked in memory.  It's weird that I can drag a file onto my Livecode stack (which is one large image control with the drag handlers in it) and get nothing.  Then, simply continuing to drag off the stack window and right back on it fixes it.
> 
> I'll continue to wrestle and post any solutions I find.
> 
> Thanks!
> 
> On May 9, 2013, at 4:59 PM, Scott Rossi wrote:
> 
>> OK, I accepted your dare and was surprised to see that it worked (didn't
>> used to).  Nice.
>> Though you're still left with the limitations of working within a single
>> stack, and no dragging in or out.
>> But if the technique works for you, awesome.
>> 
>> Speaking as someone who has rolled custom drag-and-drop code (execute in
>> your message box):
>> go url "http://www.tactilemedia.com/site_files/downloads/TMdragndrop.rev"
>> 
>> 
>> ...I'll suggest from experience that at some point it will benefit you to
>> get a handle on the built-in routines.
>> 
>> Regards,
>> 
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX/UI Design
>> 
>> 
>> 
>> 
>> On 5/9/13 1:36 PM, "Richmond" <richmondmathewson at gmail.com> wrote:
>> 
>>> On 05/09/2013 11:07 PM, Scott Rossi wrote:
>>>> Only you can know why you always use that technique,
>>> 
>>> What? you expect me to know my own mind? LOL.
>>> 
>>> I use that technique as I tend to use a single stack, or a signle stack
>>> with associated palettes.
>>> 
>>>> but with grab,
>>>> there's no way to act upon events/messages while grab is active (thus
>>>> you
>>>> can't do cursor updates and provide user feedback), and you can't "grab"
>>>> an object across stacks.
>>> 
>>> Aha; got you.
>>> 
>>> Why do I have a funny feeling that you could use
>>> 
>>> mouseStillDown
>>> 
>>> to get feedback
>>> 
>>> Ha, ha,ha . . .  I just made a stack containing a button "DRAG ME ABOUT"
>>> 
>>> and a field "KOUNT"
>>> 
>>> in the button I have this script:
>>> 
>>> on mouseDown
>>>  grab me
>>> end mouseDown
>>> 
>>> on mouseStillDown
>>>  put fld "KOUNT" into KOUNT
>>>  add 1 to KOUNT
>>>  put KOUNT into fld "KOUNT"
>>>  wait 3 ticks
>>> end mouseStillDown
>>> 
>>> on mouseUp
>>>  put empty into fld "KOUNT"
>>> end mouseUp
>>> 
>>> Try it, I dare you . . . you get feedback.
>>> 
>>> Richmond.
>>> 
>>> 
>>>> 
>>>> Regards,
>>>> 
>>>> Scott Rossi
>>>> Creative Director
>>>> Tactile Media, UX/UI Design
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 5/9/13 12:42 PM, "Richmond" <richmondmathewson at gmail.com> wrote:
>>>> 
>>>>> On 05/09/2013 09:01 PM, Mark Wieder wrote:
>>>>>> Ray Horsley <ray at ...> writes:
>>>>>> 
>>>>>>> What am I missing to get drag/drop working consistently?
>>>>>> You might also want to look at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> <http://lessons.runrev.com/s/lessons/m/4071/l/7124-pinning-drag-and-dro
>>>>>> p-
>>>>>> to-the-mat-a-primer>
>>>>>> 
>>>>> Why do I always just use
>>>>> 
>>>>> on mouseDown
>>>>>    grab me
>>>>> end mouseDown
>>>>> 
>>>>> then set up a load of images as dropTargets and have stuff like this in
>>>>> the grabbedObject:
>>>>> 
>>>>> on mouseUp
>>>>>    if not within (img "target", the mouseloc) then
>>>>>       set the loc of me to 857,673
>>>>>    end if
>>>>> end mouseUp
>>>>> 
>>>>> must be missing something.
>>>>> 
>>>>> Richmond.
>>>>> 
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> 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
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> 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
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> 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
>>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> 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
> 
> 
> _______________________________________________
> use-livecode mailing list
> 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




More information about the use-livecode mailing list