Geometry in latest version of RunRev

Ken Ray kray at sonsothunder.com
Sun Oct 21 23:42:07 EDT 2007


On Mon, 22 Oct 2007 12:49:19 +1000, Sarah Reichelt wrote:

>> The GM is good for what it does, but it can't anticipate all possible
>> combinations of object-ordering needs, and will fail in some cases.
>> 
>> Writing one's one geometry management is so simple that I never
>> understood why RunRev saddled themselves with writing 40k of GM script
>> just for a subset of needs.
>> 
>> Just use the resizeStack message, and you can trim most object resizing
>> to one-line calls using a custom function:
>> 
> 
> I agree with Richard. Writing your own gives you far better control.
> However I have 2 custom handlers: one sets the rect like Richard's and
> the other sets the loc, which is more convenient for buttons that
> don't need to resize, just move.

Agreed: Mine is more complex on the back end but perhaps simpler on the 
front end (I'll show the calls here, and if anyone is interested in the 
"backend" code let me know and I'll send it):

on resizeStack
  stsSetRect "OK",">B:-20,R:-20"  -- See (1) below
  stsSetRect "Cancel",">RL:-20","OK"  -- See (2) below
  stsSetRect "Main","BT:-20","OK"  -- See (3) below
  stsSetRect "Main","R:-20"  -- See (4) below
end resizeStack

(1) Moves btn "OK" so that its bottom is 20 pixels up from the bottom 
of the card, and 20 pixels from the right edge of the card.
(2) Moves btn "Cancel" so that its right edge is 20 pixels less than 
the left edge of btn "OK".
(3) Resizes fld "Main" so that its bottom is 20 pixels up from the top 
of btn "OK".
(4) Resizes fld "Main" so that its right is 20 pixels from the right 
edge of the card.

Regardless of which way you go though, it is pretty easy to write your 
own and then if something goes wrong, it's easier to fix. :-)



Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list