Page 1 of 1
setting layers in groups
Posted: Mon Aug 30, 2010 4:15 am
by adventuresofgreg
I have a group of charts (images) and the group has a vertical scroll bar. Part of my script relayers the images (I have a stack of charts and rather than show one and hide dozens, I would just like to relayer (set the layer of the visible image to top). However, this script moves the image OUT of the group. How do I set the layer of images and graphics in a group and leave them in the group?
Thanks
Greg
Re: setting layers in groups
Posted: Mon Aug 30, 2010 6:17 am
by Janschenkel
Before you can change the layers of controls that are in a group, you have to set the
relayerGroupedControls to true. And then you have to calculate the new layer by taking the layer of the group control itself, as well as the number of controls in the group. It's very fiddly business, so make sure to take a backup copy of your stack before you experiment.
Jan Schenkel.
Re: setting layers in groups
Posted: Mon Aug 30, 2010 1:57 pm
by adventuresofgreg
Thanks - I can see how that could get messy. The reason I'm doing it is so I can scroll to view more charts than would fit in my stack window. The alternative would be to add a scroll bar to the stack window, but I don't think that is possible - right? Any ideas?
Thanks,
Greg
Re: setting layers in groups
Posted: Mon Aug 30, 2010 7:03 pm
by Mark
Hi greg,
I don't see how a scroll bar solves your layering problem, but you can set the rect of a group to the rect of a card and add scrollbars to the group. Just use the property inspector to turn on the vScrollbar and hScrollbar properties.
Best regards,
Mark
Re: setting layers in groups
Posted: Mon Aug 30, 2010 10:20 pm
by mwieder
Why don't you want to "show one and hide dozens"? It's fast. And probably the easiest way to deal with your situation.
Code: Select all
on ShowChart pWhichChart
local tNum
lock screen
put the number of controls of group "whatever" into tNum
repeat with x=1 to tNum
hide control x of group "whatever"
end repeat
show image pWhichChart
unlock screen
end ShowChart