To grab or not to grab

Matt Denton matt.denton at limelight.com.au
Tue Jan 28 00:17:01 EST 2003


Hello List (again),

Here is a quick sample script and recipe of what I'm trying to do 
(mouseLoc isn't accurate, just for this tiny demo).

Create a graphic box paste script (see below) into it.  Now, group box 
and size up the group corners to larger than box.  Try dragging the 
graphic box, then try dragging it with the optionKey down.  For some 
reason setting the loc ignores the boundaries of the containing group 
and then resizes the group to the object...  Grab does the right thing 
but I can't get it to grab a few objects, one inside a group, the 
others outside...

on mouseDown
   if the optionKey is down then
     repeat until the mouse is up
       set the loc of me to the mouseLoc
     end repeat
   else grab me
end mouseDown

Any hel-u-p would be appreciated.

Thanks again,

M@

On Tuesday, January 28, 2003, at 04:02 PM, Matt Denton wrote:

> Hi List
>
> Firstly I want to thank Howard Bornstein and Chipp Walters for their 
> comments on my last request (Stack ID and Alt ID issue).  I was glad 
> to learn about Alt ID (thanks Howard), however I reverted to 'named 
> stack references', accepting that it is easier to manage renaming 
> references than guaranteeing a unique unchanging ID, even with Alt ID.
>
> Now a quick question, one that again is probably simple but I can't 
> work out:
>
> If you use the 'grab' form to grab an object, it stays contained 
> within the grouped object, cropping at the group's edges (desired 
> behavior).  However I want to move a disparate set of graphics, some 
> cropping to their containing group, others floating above this group.
>
> If I lock screen and set the loc of the various objects (some inside a 
> group), the containing object ignores and/or expand their group!   I 
> have worked out a smoke and mirrors version but I'm not too happy with 
> it.
>
> Anyone know how to get a contained object to respect its group 
> boundaries (and crop) without using the 'grab' form?
>
> Cheers and many thanks!
>
>
> M@
> Matt Denton




More information about the use-livecode mailing list