Drag and Drop to Item in List Field

Bill Vlahos bvlahos at mac.com
Thu Nov 18 19:41:53 EST 2010


Getting closer now.

If I put the following script in the source list field the correct text is sent in the drag.
on mouseDown
   set the dragData["text"] to the selectedText
end mouseDown

Target field script hilites the correct line in the list
on dragMove
  set the hilitedLines of me to (word 2 of the mouseLine)
end dragMove

However, if I also put this script in the target field script nothing happens:
on dragDrop
   put the dragData["text"]
   pass dragDrop
end dragDrop

What I need is the dragged text and the target field line. I believe I can only get that from the target field not the source field but I can't figure out how.

Bill Vlahos

On Nov 16, 2010, at 4:10 PM, Bill Vlahos wrote:

> Terry and Marty,
> 
> Thanks for the suggestions. They both work.
> 
> Since this is a drag and drop scenario this script looks like it does what I want.
> on dragMove
>   set the hilitedLines of me to (word 2 of the mouseLine)
> end dragMove
> 
> Bill
> 
> On Nov 16, 2010, at 3:52 PM, Terry Judd wrote:
> 
>> How about this...
>> 
>> on mouseMove
>>   set the hilitedLines of me to (word 2 of the mouseLine)
>> end mouseMove
>> 
>> Terry...
>> 
>> 
>> On 17/11/10 10:39 AM, "Bill Vlahos" <bvlahos at mac.com> wrote:
>> 
>>> The following script works very well with one problem. This script hilites the
>>> line correctly but just keeps hiliting lines as I move the mouse around and
>>> they stay hilited.
>>> 
>>> Make a scrolling field with some lines of text and put this handler in it:
>>> 
>>> on mouseWithin
>>>  set the backgroundColor of the mouseLine to "yellow"
>>> end mouseWithin
>>> 
>>> How do I have it only hilite one line at a time?
>>> 
>>> Bill Vlahos
>>> 
>>> On Nov 12, 2010, at 11:12 PM, Bill Vlahos wrote:
>>> 
>>>> I have a list of categories and I want to drag and drop some text from a list
>>>> field onto one of the categories in the target list field. The line of text
>>>> should hilite on the drag (before the drop) so I know which item it is going
>>>> to I should drag into.
>>>> 
>>>> I can get most of the coding for drag and drop but there are some things I
>>>> don't know.
>>>> 1. How do I hilite the line of text in the list field the mouse is over?
>>>> 2. How do I get the line of text in the target list field when the users
>>>> drops the mouse?
>>>> 
>>>> Bill Vlahos
>>>> _________________
>>>> InfoWallet (http://www.infowallet.com) is about keeping your important life
>>>> information with you, accessible, and secure.
>>>> 
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your subscription
>>>> preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>> 
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription
>>> preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
>> --
>> Dr Terry Judd | Senior Lecturer in Medical Education
>> Medical Education Unit
>> Melbourne Medical School
>> The University of Melbourne
>> 
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list