Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-08

Alignment

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Micha Nelissen: Currently aligning is done recursively, if you setbounds on a form which has a nested…
Show quoted text 15 lines
Hi, Currently aligning is done recursively, if you setbounds on a form which has a nested tabcontrol with a nested form with a nested form then the recursion goes down to the last form setting width/height and back up. The problem is that the win32 interface have differences between window/client size and this cannot be compensated if this resizing is done in one step. You can see this bug in the object inspector, differences accumulate causing the scrollbar to be partly visible among other things. It could be done if the form aligned it's controls and those controls call the interface immediately with their new position/size. Then the interface will report the new size back to the lcl which then continues aligning it's controls until all is done. How about it?

We can add an interface function, to ask if bounds should be cached or sent directly. But before doing this, we should make sure that the win32 intf is doing, what it is told do to.
I have created a new example with a three nested groupboxes, all Align=alClient. (Unable to commit, because now the name server does not even know cvs.freepascal.org).

When you do this and add writeln in TWinControl.DoSendBoundsToInterface; and TWinControl.InvalidateClientRectCache;, you can see at least three bugs:

- The form is not resized after the LCL asked
the win32 interface to do so.
- the groupboxes are not resized after the LCL
asked the second time the win32 interface to do so
- The win32 intf does not tell the LCL, that
the clientrect of the groupboxes have changed

I think, these bugs must be fixed first before optimizing the LCL.

Mattias

Reply by email

Micha Nelissen

Hi,

Currently aligning is done recursively, if you setbounds on a form which has a nested tabcontrol with a nested form with a nested form then the recursion goes down to the last form setting width/height and back up. The problem is that the win32 interface have differences between window/client size and this cannot be compensated if this resizing is done in one step. You can see this bug in the object inspector, differences accumulate causing the scrollbar to be partly visible among other things. It could be done if the form aligned it's controls and those controls call the interface immediately with their new position/size. Then the interface will report the new size back to the lcl which then continues aligning it's controls until all is done.

How about it?

Micha.

Reply by email

Micha Nelissen
to Micha Nelissen
Mattias Gaertner wrote 27 lines
On Tue, 12 Aug 2003 16:34:24 +0200 Micha Nelissen wrote: >Hi, > >Currently aligning is done recursively, if you setbounds on a form which >has a nested tabcontrol with a nested form with a nested form then the >recursion goes down to the last form setting width/height and back up. >The problem is that the win32 interface have differences between >window/client size and this cannot be compensated if this resizing is >done in one step. You can see this bug in the object inspector, >differences accumulate causing the scrollbar to be partly visible among >other things. It could be done if the form aligned it's controls and >those controls call the interface immediately with their new >position/size. Then the interface will report the new size back to the >lcl which then continues aligning it's controls until all is done. > >How about it? We can add an interface function, to ask if bounds should be cached or sent directly. But before doing this, we should make sure that the win32 intf is doing, what it is told do to. I have created a new example with a three nested groupboxes, all Align=alClient. (Unable to commit, because now the name server does not even know cvs.freepascal.org).

I just keep retrying until it works, usually it does within a couple of tries.

Show quoted text 11 lines
When you do this and add writeln in TWinControl.DoSendBoundsToInterface; and TWinControl.InvalidateClientRectCache;, you can see at least three bugs: - The form is not resized after the LCL asked the win32 interface to do so. - the groupboxes are not resized after the LCL asked the second time the win32 interface to do so - The win32 intf does not tell the LCL, that the clientrect of the groupboxes have changed I think, these bugs must be fixed first before optimizing the LCL.

Ok, good point. Awaiting the example to appear in CVS...

Micha.

Reply by email