Dragging from a list field

Trevor DeVore lists at mangomultimedia.com
Sun Aug 28 02:29:25 EDT 2005


On Aug 27, 2005, at 11:11 PM, J. Landman Gay wrote:
> That's very similar to what I was doing, and I saw the same  
> results. I found that if I pass mouseDown on the first line then it  
> works okay. So I'm checking for a condition first:
>
> on mouseDown
>   if <condition> then pass mouseDown -- allows selectionChanged to  
> trigger
>   -- set dragData, implement dragging here
> end mouseDown
>
> And this seems to work okay. Unfortunately it doesn't solve the  
> problem of what condition to actually check for. I don't think  
> there's a way to differentiate between clicking on a list and  
> dragging from a list without adding a user action, so right now I'm  
> checking to see if the Option key is down. If so, we're dragging.  
> I'd rather be able to just tell without involving the user though.

Right.  The condition I used was a repeat loop that checks for how  
long the user has been holding down the button.  If they click on  
hold for at least 200 milliseconds then I assume they have started a  
drag.  The problem is that the repeat loop kills selectionChanged too  
(that is the bug # I posted before).

For the project I implemented this in, drag/drop from a palette is  
something that is done hundreds of times.  I didn't want to add any  
modifier keys, etc. for something being done so often so I just added  
code in mouseDown to check for a change in the selection.  That way I  
could have my repeat loop and display data on the selected item.


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com





More information about the use-livecode mailing list