"grab me" script off page

Bob Sneidar bobs at twft.com
Wed Dec 14 22:12:08 EST 2011


Okay I just checked it out, and the dragMove is not getting sent at all with the pointer tool selected. So I turned on the message watcher to see what messages DO get sent. I found one, but it doesn't get sent until AFTER you let go of the object. Still, it can work for you I think. 

Put this into your stack script:

on moveControl
    put the selectedobject into theObject
      put the top of theObject into myTop
      put the left of theObject into myLeft
      put the bottom of theObject into myBottom -- sorry it just works out that way. 
      put the right of theObject into myRight
    
    if myTop < 0 then
        set the top of theObject to 0
    end if	
    if myLeft < 0 then
        set the left of theObject to 0
    end if
    if myBottom > the height of this stack then
        set the bottom of theObject to the height of this stack
    end if
    if myRight > the width of this stack then
        set the right of theObject to the width of this stack
    end if
    pass moveControl
end moveControl

That is the best I can do. There may be hidden messages that are getting sent during a drag operation with the pointer, but I am not aware of it. This script above will reposition any object that was dragged off screen, even partially to a position touching the edge it was dragged beyond. Give it a try. 

Bob


On Dec 14, 2011, at 6:38 PM, Kathy Jaqua wrote:

> Thank Bob,
> 
> I am not quiet sure what you mean. 
> I am just dragging a graphic inside a stack. 
> How does one trap for something.
> 
> Could you be a bit more specific? It's been a while...
> 
> Kathy Graves Jaqua 
> _______________________________________________
> 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