Sign in Join

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

Mailing lists / lazarus / 2003-07

Automatic resizing in LCL and VCL

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Micha Nelissen
to Mattias Gaertner: There are some ambigious things in the autoresizing of the VCL and LCL and so I want to…
Mattias Gaertner wrote
Hi, There are some ambigious things in the autoresizing of the VCL and LCL and so I want to define/discuss them.

...

alClient - As above, with the exception that the VCL does almost never reduce. Therefore two controls with alClient will overlapp. The LCL never reduce the client area on alClient. I thought, this was a bug, till Michas mail.

Great! Something to work with, to test by.

1) Is the current LCL implementation according to these specs?
2) What does the LCL do with alClient? Overlap too? If so, then alClient controls need to be processed last in resizing calculations, is that true?

Regards,

Micha.

Reply by email

Mattias Gaertner
to Mattias Gaertner: There are some ambigious things in the autoresizing of the VCL and LCL and so I want to…
Show quoted text 15 lines
Mattias Gaertner wrote: > Hi, > > There are some ambigious things in the autoresizing of the VCL and LCL > and so I want to define/discuss them. ... > alClient - As above, with the exception that the VCL does almost never > reduce. Therefore two controls with alClient will overlapp. The LCL > never reduce the client area on alClient. I thought, this was a bug, > till Michas mail. Great! Something to work with, to test by. 1) Is the current LCL implementation according to these specs?

Yes

2) What does the LCL do with alClient? Overlap too?

Yes

If so, then alClient controls need to be processed last in resizing calculations, is that true?

Almost. The order is the same as in the VCL:
Top, Bottom, Left, Right, Client, Custom, None

Mattias

Reply by email

Mattias Gaertner

Hi,

There are some ambigious things in the autoresizing of the VCL and LCL and so I want to define/discuss them.

Aligning and anchoring are the main parts of the LCL automatic child positioning and resizing. Other factors like constraints, AdjustClientRect, control order, scaling, loading process, user defined resizes, themes, interface specials, ... makes the automatic resizing a very complex process. And of course the current properties are not sufficient. On my wishlist are gaps, connected controls and aligning controls and I guess there are people with more wishes. And last but not least we should try to keep VCL compatibility.
For the compatibility: It is clear, we will never achieve 100%. Some of the VCL controls uses some win32 specific tricks, which not all widgets of all interfaces support. And LCL applications should "work" the same with all interfaces. "Work" does neither mean look nor size. The Delphi help is ambigious at this place and does not describe the whole behaviour. Therefore we need definitions, how the automatic resizing should work.

Anchors:
- combinations of akLeft/akRight with akTop/akBottom are independent
- [akLeft] - try to keep "Left". This means, try to keep the distance of the left border of the control and the left border of the client area of the parent. If Align=alRight, then the "Width" will be adjusted, when the parent is resized. The LCL tries to keep the last user defined "Left". So, it will use the "Left" after loading, but not during loading, it will use the "Left" of a SetBounds, but not the Left from a size message from the interface and not the Left of the automatic resizing.
The same for [akRight], [akTop], [akBottom].
- [akLeft,akRight] will try to keep both, the left and right distance by adjusting the width.
The same for [akTop,akBottom].
- [] will try to keep the width(height) and center the control.
- The minimum Width and Height is 0.

Align:
alLeft - try to keep "Width", try to set "Left" to the left edge of the remaining client area, try to set "Top" to the top edge and "Width" to the width of the remaining client area. The kept "Left" is the same as under Anchors.
Same for alRight, alBottom, alTop.
After the aligning, the remaining client area is reduced. alClient - As above, with the exception that the VCL does almost never reduce. Therefore two controls with alClient will overlapp. The LCL never reduce the client area on alClient. I thought, this was a bug, till Michas mail.

The VCL has some exceptions to this rules. But they are not mentioned in the Delphi Help and most of them exists because some of the VCL controls do not cleanly distinguish between client area and bounds.

Mattias

Reply by email