[Lazarus] New autosize sucks

zeljko zeljko at holobit.net
Fri Apr 23 08:14:37 CEST 2010


On Thursday 22 April 2010 23:36, Mattias Gaertner wrote:
> On Thu, 22 Apr 2010 17:36:36 +0200
>
> Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
> > Is it only me, or have more users noticed the many changes, required to
> > make existing code work without -dOldAutoSize?
>
> AFAIK you and me are the only one working on docking.
>
> > I understand that it may take some more time to finish the autosize
> > redesign, so let me report some observations:
>
> According to the bug tracker there is only one issue left and no
> developer can reproduce it:
> http://bugs.freepascal.org/view.php?id=16184

I'm still using -dOldAutoSize for my projects since newAutoSize isn't 
compatibile with K3/D7 way of resizing.
eg. I'm resizing stringgrid columns in form OnResize event.

With such example (new autosize) , maximize form -> nothing happens with grid,
now restore form size, columns are resized but grid thinks that form is 
maximized.
var 
  i: integer;
  j: integer;
begin
  i := MyGrid.Width;
  for j := 0 to MyGrid.ColCount - 1 do
    MyGrid.ColWidths[j] := i div 10;
end;


1.It works correct with -dOldAutoSize
2.It works correct with Delphi/Kylix
3.It does not work correct with new autosize.

I have not enough time to investigate what's wrong but I know that my 
tstringgrid columns aren't resized in form's OnResize event in case of new 
autosize.Probably resize events are in opposite order so Form.OnResize is 
triggered first but children are not resized yet. Yes, I know that you wrote 
somewhere that we should use OnResize() for each control we want to track, 
but what should I do now with my project which have > 400 forms, open each 
form add OnResize to each control I need to resize ? 
Maybe I'm wrong (didn't look into), but seem that delphi/kylix triggers 
form.OnResize when everything is resized inside form (children), or it 
triggers twice : at form resize, and then after all children resized.

zeljko




More information about the Lazarus mailing list