Quantcast

Bitten by Group Default Margins

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bitten by Group Default Margins

Sannyasin Brahmanathaswami via use-livecode
We discussed this before on this list, but I wanted to bring it up again. I don't remember any conclusions.

Are we the only ones who would prefer that the engine not auto set group margins to 4?

This bit us  hard recently as one member of the team who was not familiar with this issue spent a lot of time trying to get some dynamic responsive layout to work.

Even if the script set the group rect to

0,0,50, (the width of this card)

and then you created a background grc

0,0,50, (the width of this card)


We kept seeing a 4 pixel transparent  offset on the screen, as if the group were offset (in fact it wasn't the margins were forcing child elements to be inset, as if the coords of the child controls were relative to the 4 x offset of the group. instead of the card itself.

it got worse: even if you set the margins of the group to 0 *after* resizing all it's child elements, the prop inspector, after the layout was done, showed margins were 4 pixels, which to me seems completely "bogus"

The only way I could get it to lay out correctly was this this esoteric hack:

# at the beginning of the layout handler:

set the width of group "header" to (the width of this card +8) # over compensate for the default margins
set the left of group "header" to -4 # centers the group so that the x,y coord of the child elements are now at card edge
set the top of group "header" to 0
set the margins of group "header" to 0 # Important! so that child elements will not be offset.

# now you can set all the child elements to the width of the card
# and when you inspect the group, the topleft is 0 and the margins are 0

isn't this "just wrong" ??  Doesn't it make more intuitive sense that if I set a group topleft to 0,0 and  child element to 0,0 that it would be flush with the top left of the card?

BR







_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bitten by Group Default Margins

Sannyasin Brahmanathaswami via use-livecode
Sannyasin Brahmanathaswami wrote:

 > Are we the only ones who would prefer that the engine not auto set
 > group margins to 4?

I would prefer 0, but we're about 20 years too late to change it now.

Easy enough to change the property to anything you want.

 > it got worse: even if you set the margins of the group to 0 *after*
 > resizing all it's child elements, the prop inspector, after the
 > layout was done, showed margins were 4 pixels, which to me seems
 > completely "bogus"

Does the margin of the group itself become smaller when you set it to a
smaller number?

There may be an update bug in the PB; one way to check that would be to
close and then re-open the PB.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...