GoListGroup sizing

Normally, a GoListGroup sizes automatically depending on the items it contains.



In my case, I want to control the size of the listgroup so it always has a specified row height (and width).



My listgroups contain GoTexts that have to be centered vertically, and left aligned or centered horizontally.



I am trying to set the resulting row height by specifying the size of the GoTexts in the list.



How do I set the text height, alignment and the various margins (and spacing ?) so that I get the row height I want ?

GoListGroup uses the sizes of the items put into it (plus the TopLeft and Bottom margins, plus the Spacing between items).

There is no alignment or control over per-Item size provided by GoListGroup.
But... you can set GoText items to AutoResize=false, and can set their width and height. Once you've done that, you can also set Gotext Alignment.

Ok, but what is the relationship between the GoText size and the resulting listgroup sizing ?



The GoText is the size it is, the GoListGroup wraps around it. The total size of the GoListGroup is the sum of the sizes of the items in it, plus the margin and “Spacing” between items.

Yes, but do the lines also contribute to the total size ?



If I specify a LinePen with a width > 0, the size of each item appears to grow by the line width, and the total size by the sum of the line widths.

This does not happen with the BorderPen, which just centers a line over the bound lines.



This is nasty, since I pick a thicker pen when printing, which upsets the layout of my tables built with GoListGroups.

GoListGroup uses the Max of LinePenInfo.Width and Spacing as the value to add to the height for each “space”.

So, you can set Spacing to at least what you set the Pen Width to when printing and you should be OK.

Thanks, that will help.



Another, related issue: for a horizontally oriented GoListGroup, the left margin only seems to apply to the leftmost item, and the right margin only to the rightmost item.



Shouldn’t the margin apply to all items in the group ?

So…



other than pre-pending the text with spaces, is there another option to provide some margin for left-aligned texts in horizontal GoListGroup ?

You can set TopLeftMargin.

Yes, but TopLeftMargin.Width only appears to affect the leftmost item in a horizontal listgroup.



Likewise, BottomRightMargin.Width only affects the rightmost item.



How do I affect the items in between ?

All items are left-aligned within the list.

GoListGroup doesn’t give you alignment-per-row control (or column if horizontal). Think of GoListGroup as a rectangle within a rectangle. The inner rectangle is the minimum sized box you can wrap around the “items” you add to the list PLUS the “Spacing” property space between rows/columns. The outer rectangle is defined by the TopLeft and BottomRight margins around that inner rectangle.