1

I would like to extend the question given here at SO

I dropped one TGridpanel my form and i would like to set the ratio between first and second row. Target should be 15 % for row #1 and 85 % for row #2. Open up the value editor and entering eg. 15 in the OI i get values close to the target value (15,2%) but not the correct ones. What is going wrong ? With other ratio values the error is in the range up to 5 %

Tgridpanel

Community
  • 1
  • 1
user1769184
  • 1,571
  • 1
  • 19
  • 44
  • 2
    I never found a way around this and always press [Alt]+[F12] to edit the DFM syntax of the `TGridPanel` manually, then press [Alt]+[F12] again to switch back to the design view which should now be correct. – Günther the Beautiful Aug 24 '16 at 07:56
  • It is odd behaviour. I have found that repeatedly entering the number you want will get there. Using your example, I entered 15 6 times before it settle at 15 / 85. @GünthertheBeautiful's idea is good - I'll consider using that when there are more than 2 columns. As to why it happens, I've no clear idea. – Michael Vincent Aug 24 '16 at 08:11
  • Delphi was always bad with floats in DFM and sub-pixel accuracy in controls positioning. The basic design was made 20 years ago for 16-bit processors and they squeezed every tick-tock they could. Today VCL is badly hurt by it with different DPI on modern screens... – Arioch 'The Aug 24 '16 at 08:49
  • @Arioch'The, Well, the behaviour is exactly the same on FireMonkey. I'm sure there is some kind of logic. Set both columns to zero percent, and both get exactly 50%. Now set the first one to 100%, it becomes 66,66%. Probably because that's 100/(100+50) – Günther the Beautiful Aug 24 '16 at 09:57
  • "*What is going on?*" The accepted answer to the question you linked to, explains exactly what is going on. Sorry, but this question should be closed as a duplicate. – Tom Brunberg Aug 24 '16 at 09:59
  • 1
    Possible duplicate of [Delphi How to use TGridPanel](http://stackoverflow.com/questions/3838062/delphi-how-to-use-tgridpanel) – Tom Brunberg Aug 24 '16 at 10:00
  • For what I remember exactly tendency of FMX to use floats highlighted problems of DFM engine in saving it. Maybe it was fixed with newer Delphi releases, dunno – Arioch 'The Aug 24 '16 at 11:32

0 Answers0