Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TGridPanelLayout in Delphi10Seattle


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Oct 2, 2015 3:51 AM Last Post By: Mark Gorst
Mark Gorst

Posts: 23
Registered: 6/7/02
TGridPanelLayout in Delphi10Seattle  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 1, 2015 8:13 AM
I've got some Firemonkey code which was working fine in XE7 but has changed behaviour in 10Seattle. It's the sizing of rows and columns with a TGridPanelLayout control.

I'm added buttons to the control - think of it as dynamically creating a keypad. The default size is 2 x 2. I add extra columns and rows using TRowCollection.Add or TColumnCollection.Add for the desired size and then add TButtons with TControlCollection.AddControl.

This all worked fine under XE7. What I found when I changed to 10Seattle (such a snappy name) is that by default the RowItems / ColumnItems now had default properties of "percent" and "0" and so didn't show, whereas before they were Auto and I got a nice even grid.

I fixed that after adding all my controls by running through and explicitly setting the values to "percent" and a suitable value (e.g. 33 if there are 3 on a row).

However, what I'm finding is that the first row and column are not then showing the same size as the others.

Any suggestions ?
Eli M

Posts: 1,346
Registered: 11/9/13
Re: TGridPanelLayout in Delphi10Seattle  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 1, 2015 8:21 PM   in response to: Mark Gorst in response to: Mark Gorst
At design time every time you change that value it averages the other values. So you have to keep changing them to get as close as you can to the number you want. Or you can right click the form View As Text and set it manually.
Mark Gorst

Posts: 23
Registered: 6/7/02
Re: TGridPanelLayout in Delphi10Seattle  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 2, 2015 3:51 AM   in response to: Eli M in response to: Eli M
Eli M wrote:
At design time every time you change that value it averages the other values. So you have to keep changing them to get as close as you can to the number you want. Or you can right click the form View As Text and set it manually.

Thanks. That's enabled me to sort it. A rather inelegant "for iLoop:=1 to 5 do" around the resizing sorts them out nicely. It's not ideal, but there's a demo on Monday !
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02