Distribute objects

xavier.bury at clearstream.com xavier.bury at clearstream.com
Thu Nov 10 04:08:52 EST 2005


Here's one from GIM, my Geometry Interface Manager library (used in TAOO)
I stripped the non-related statements.

Funny, i had just adjusted it a couple of days earlier ;)

on DistributeWidthsTo objs,tObj
  local t, tdiv, startx, stopx
  put the width of tObj into t
 
    put (t-Delta) div (the number of lines in objs) into tdiv
    put the left of tObj+Delta into startx
    --put 8 into startx
    put the right of tObj into stopx

  repeat for each line l in objs
    try
      set the width of l to (tdiv - Delta)
      set the left of l to startx
      add tdiv to startx
    catch err
      if "taoodebug" is in the stacks then TAOODebugAddLogEntry l & cr & 
err
     else answer "Error in DistributeWidthsTo execution:" && err -- 
replace with answer or put into msg if no taoo debug stack
    end try
  end repeat
end DistributeWidthsTo

to use it...

on resizestack
  -- distribute buttons
  put the long name of btn "script" of me & cr & \
      the long name of btn "start" of me & cr & \
      the long name of btn "help" of me & cr & \
      the long name of btn "save" of me & cr & \
      the long name of btn "close" of me into objs
 
  DistributeWidthsTo objs, the long name of me
 end resizestack

cheers
Xavier
http://monsieurx.com/taoo


> Has anyone got a button script to distribute equally (horizontally 
> or vertically) the space between a bunch of selected objects? I miss
> this from SuperCard. Thanks.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



-----------------------------------------
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is 'firstname.familyname at clearstream.com'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the use-livecode mailing list