Group Locations
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Group Locations
Hi Guys
I have been banging my head against the wall over the last couple of days trying to work out a way of placing groups so that they are aligned and placed on above each other with no overlap.
Is there a short script I can use so that if i click a button that all groups that are visible on a card are placed neatly aligned to the left and directly above each other?
You help would be most appreciated!
Thanks
Daniel
I have been banging my head against the wall over the last couple of days trying to work out a way of placing groups so that they are aligned and placed on above each other with no overlap.
Is there a short script I can use so that if i click a button that all groups that are visible on a card are placed neatly aligned to the left and directly above each other?
You help would be most appreciated!
Thanks
Daniel
Re: Group Locations
Did you try something like?
Or does the change to the boundary when you group the objects mess it up?
Code: Select all
local tTop, tLeft, tGrp, tGrpList
-- Put list of grps affected into tGrpList
put <desired starting top location> into tTop
put <desired left location> into tLeft
repeat for each grp tGrp in tGrpList
set the topLeft of grp tGrp to tLeft,tTop
put the bottom of grp tGrp into tTop
end repeat
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Group Locations
Hi! Thanks for this - I have tried the script but get the folllowing error message:
button "Button": compilation error at line 7 (repeat: bad termination condition) near "tGrp", char 12
button "Button": compilation error at line 7 (repeat: bad termination condition) near "tGrp", char 12
Re: Group Locations
Hi Daniel,
unfortunately "repeat for each..." does not work with object on cards!
Use "repeat with i = 1 to the num of grps..." instead.
But please post your complete script to be sure!
Best
Klaus
unfortunately "repeat for each..." does not work with object on cards!
Use "repeat with i = 1 to the num of grps..." instead.
But please post your complete script to be sure!
Best
Klaus
Re: Group Locations
Sorry, I was too quick. I put this in a button and made 3 groups, G1, G2, and G3.
Code: Select all
on mouseUp
local tTop, tLeft, tGrp, tGrpList, tGrpNum
put "g1" & comma & "g2" & comma & "g3" into tGrpList
put 50 into tTop
put 50 into tLeft
repeat with tGrpNum = 1 to the number of items in tGrpList
put item tGrpNum of tGrpList into tGrp
set the topLeft of grp tGrp to tLeft,tTop
put the bottom of grp tGrp into tTop
end repeat
end mouseUp
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Group Locations
Briliant thank you very much!!!
What actually determines the gap in between each group?
What actually determines the gap in between each group?
Re: Group Locations
Hi Daniel,
it is the borderwidth of the group (if shown and greater than 0) and the margins of the group. Look in the properties inspector -> Text formatting. Set the margins to 0 and if the border is not shown then you will see the groups stacked upon each other.
regards
Bernd
it is the borderwidth of the group (if shown and greater than 0) and the margins of the group. Look in the properties inspector -> Text formatting. Set the margins to 0 and if the border is not shown then you will see the groups stacked upon each other.
regards
Bernd
Re: Group Locations
wow - that simple, fantastic. Thank you for your help!