Rép : problem with drag-dropping a text string (was: Re: use-revolution Digest, Vol 55, Issue 24)
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Sun Apr 13 04:45:23 EDT 2008
Hi Peter,
I made further experiments and I found that setting the dragData
["text"] to the dragData["text"] && "modified" did not work when
setting the dragData["text"] to <some string> works.
So would the following, using the selectedText function, work for you:
on dragStart
set the dragdata["text"] to Transform(the selectedText) --
end dragStart
-----------------------
function Transform pText
return pText && "modified"
end Transform
Le 12 avr. 08 à 23:18, Peter Brigham a écrit :
> Merci, Eric --
>
> My "on dragLeave" handler is in the f1 script, so it's triggered
> when I drag the selectedtext out of the originating field. The
> handler gets triggered OK -- if I set a breakpoint the debugger
> opens as my drag leaves the field. For my current needs I will
> always be dragging text from f1 to f2, so I tried to do my
> modification in a dragLeave handler in f1, because putting it in
> the dragStart handler fails to work. As I said in my original post,
> if I try in a dragStart handler in f1 to set the dragActions and
> the allowableDragActions to "copy" and to modify the dragData, I
> don't get a drag-copy and I don't get my text modified, I just get
> the standard drag-move of the original text. On my system if I try
> to even just "get the dragData" in a dragStart handler it returns
> empty. And I can't seem to *set* the dragData (or the dragData
> ["text"]) at all no matter what handler I put it in or in which
> script (f1 or f2).
>
> Again, it's a very simple set-up, two fields, drag from f1 to f2,
> and the only script I have is the one given below, and whether I
> put it in a dragstart handler in f1 or in a dragleave handler in f1
> or a dragEnter or dragDrop handler in f2, the text is never
> modified. And in dragstart, the dragdata is empty when I "get" it,
> never mind trying to modify it. At least in a dragLeave handler I
> can actually *get* the dragData. I can't *set* it at all, anywhere.
>
> This seems like a bug (or bugs), but it's obviously only cropping
> up in my particular setup. Mac iBook G4, OSX 10.4.1, Studio 2.9
> build 610. Anyone see something I'm overlooking?
Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------
More information about the use-livecode
mailing list