Moving Objects in the IDE

Jim Hurley jhurley at infostations.com
Thu Apr 8 09:25:31 EDT 2004


>
>Message: 1
>Date: Thu, 8 Apr 2004 10:58:39 +0100
>From: David Burgun <dburgun at dsl.pipex.com>
>Subject: Moving Objects in the IDE
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Message-ID: <a05210603bc9ad22039c1@[192.168.1.102]>
>Content-Type: text/plain; charset="us-ascii" ; format="flowed"
>
>Hi,
>
>One thing that I've found very useful in other GUI design apps is the
>ability to move GUI objects around in the Window (stack/card) and
>constrain their movement to either the X or Y axis. This is usually
>acheived by dragging with the Shift or Option key down. Is there a
>way to do this in RunRev?
>
>TTFN
>Dave

Dave,

The simplest solution is mouse-dependant. With a Kensington optical 
mouse on my Mac and the following handler in the control script:

on mouseDown
grab me
end mouseDown

you can use the shift key to constrain the control to horizontal or 
vertical movement. (I like this programmable mouse a great deal. Very 
versatile.)

There is also a somewhat cumbersome solution which should work with 
other mice. Try the following handler in the control script:

local myName, tLoc

on mouseDown
   put the name of me into myName
   put the loc of me into tLoc
end mouseDown

on mouseUP
   put "" into myName
end mouseUP

on mouseLeave
   put "" into myName
end mouseLeave

on mouseMove x,y
   if myName is "" then exit mouseMove
   if the shiftKey is down then set the loc of me to x, item 2 of tLoc
   else set the loc of me to item 1 of tLoc, y
end mouseMove

In this was the control is constrained to horizontal movement if the 
shift key is down, and vertical if the shift key is up

Jim.


More information about the use-livecode mailing list