Geometry not working?
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller
Geometry not working?
Hi Guys,
I've got an unusual situation with the Geometry of an object. I've got a datagrid in my app and I want to "anchor" the bottom of the datagrid to about a cm off the bottom of the card so if the user enlarges the card, the datagrid would extend or contract depending on the depth of the card. So I highlighted the datagrid went over to the Geometry palette, selected the scale selected object and clicked on the bottom and right red bars. When I resize the card, the datagrid remains fixed in size. Anyway I've tried othe combinations to get my datagrid scaling according to the card size but not having much luck.
I then decided to test this feature out on a new main stack, dragged a datagrid across and applied the geometry settings I applied to my real app. This time it worked exactly the way I want. So went back over to my real stack and tried to reapply the same behaviour and the datagrid just doesn't scale.
I'm confused, why would one work and the other not, seems a little inconsistent behaviour. I know its difficult to suggest why it could not be working without looking at the stack, but has anyone come across this? My main app has lots more objects on including a couple of data grids fields, labels etc, but that should not make a difference should it?
Best
Jalz
I've got an unusual situation with the Geometry of an object. I've got a datagrid in my app and I want to "anchor" the bottom of the datagrid to about a cm off the bottom of the card so if the user enlarges the card, the datagrid would extend or contract depending on the depth of the card. So I highlighted the datagrid went over to the Geometry palette, selected the scale selected object and clicked on the bottom and right red bars. When I resize the card, the datagrid remains fixed in size. Anyway I've tried othe combinations to get my datagrid scaling according to the card size but not having much luck.
I then decided to test this feature out on a new main stack, dragged a datagrid across and applied the geometry settings I applied to my real app. This time it worked exactly the way I want. So went back over to my real stack and tried to reapply the same behaviour and the datagrid just doesn't scale.
I'm confused, why would one work and the other not, seems a little inconsistent behaviour. I know its difficult to suggest why it could not be working without looking at the stack, but has anyone come across this? My main app has lots more objects on including a couple of data grids fields, labels etc, but that should not make a difference should it?
Best
Jalz
-
- VIP Livecode Opensource Backer
- Posts: 7323
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Geometry not working?
Hi.
There is only one thing more mysterious than a dataGrid, and that is the geometry manager. I will not go so far to say that it is possessed, but I have heard strange noises at night in its vicinity.
Why not just set the botright of the group to the botRight of the card, minus a few pixels? You have to manage this just a little, but only a little.
Craig Newman
There is only one thing more mysterious than a dataGrid, and that is the geometry manager. I will not go so far to say that it is possessed, but I have heard strange noises at night in its vicinity.
Why not just set the botright of the group to the botRight of the card, minus a few pixels? You have to manage this just a little, but only a little.
Craig Newman
Re: Geometry not working?
Hi Craig
Lol - both of the things I've tried to get my head around
……
Your idea of set the botright of the group to the botRight of the card is something that didn't even occur to me. Was looking for the easy way out with the Geometry manager. I've got your suggestion working along with the resizeStack handler. Shame geometry is buggy, would have liked to use the clicky tools when I can
Lol - both of the things I've tried to get my head around

Your idea of set the botright of the group to the botRight of the card is something that didn't even occur to me. Was looking for the easy way out with the Geometry manager. I've got your suggestion working along with the resizeStack handler. Shame geometry is buggy, would have liked to use the clicky tools when I can

Re: Geometry not working?
Just a thought, if you still have your test stack. If you add a second data grid does it still work correctly? And if you set some geometry on the new grid too? I'm wondering if the GM is getting confused because of the multiple references to a datagrid group.
Re: Geometry not working?
Hi Sparkout,
I created a brand new main stack just to try it out as was intrigued. I placed 3 data grids, 2 fields, 3 option boxes, a label and locked right and bottom of the objects. All scale exactly as I would have expected. Tried applying geometry on the datagrid in my app and it fails. My app has lots of objects so it could be anything that could be preventing the correct behaviour.
I created a brand new main stack just to try it out as was intrigued. I placed 3 data grids, 2 fields, 3 option boxes, a label and locked right and bottom of the objects. All scale exactly as I would have expected. Tried applying geometry on the datagrid in my app and it fails. My app has lots of objects so it could be anything that could be preventing the correct behaviour.
Re: Geometry not working?
Hi,
I have another issue I need some advice on regarding these objects expanding and contracting dependant on card height. I've got a coloured rectangle on my card and I want to basically stretch the rectangle so it fits the height of the card. I've got the following code which I thought would have sorted me but I can either lock to the top of the page or the bottom of the page, can't seem to lock both so the rectangle grows.
I have another issue I need some advice on regarding these objects expanding and contracting dependant on card height. I've got a coloured rectangle on my card and I want to basically stretch the rectangle so it fits the height of the card. I've got the following code which I thought would have sorted me but I can either lock to the top of the page or the bottom of the page, can't seem to lock both so the rectangle grows.
Code: Select all
on resizeStack
--set the lockLocation of graphic "Rectangle" to true
set the top of graphic "Rectangle" to the top of this card
set the bottom of graphic "Rectangle" to the bottom of this card
end resizeStack
Re: Geometry not working?
Hi Jalz,
well, setting the left, top, right or bottom of an object does not change its dimension, just its location!
Do something like this by setting the rect of your graphic and note the handy parameters that come with "resizestack"
Best
Klaus
well, setting the left, top, right or bottom of an object does not change its dimension, just its location!
Do something like this by setting the rect of your graphic and note the handy parameters that come with "resizestack"

Code: Select all
on resizeStack newWidth,newHeight,oldWidth,oldHeight
lock screen
put the rect of graphic "Rectangle" into tRect
put 0 into item 2 of tRect
put newHeight into item 4 of tRect
set the rect of graphic "Rectangle" to tRect
unlock screen
end resizestack
Klaus
Re: Geometry not working?
Thanks Klaus - much appreciated