[Lazarus] AlignControls

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Feb 1 12:42:45 CET 2013


Juha Manninen <juha.manninen62 at gmail.com> hat am 1. Februar 2013 um 11:56
geschrieben:
> I am trying to figure out how AlignControls works.

It's complicated.


> The signature is:
>
> procedure AlignControls(aControl: TControl; var aRect: TRect); override;
>
> What exactly is aControl for? Delphi's documentation says:
> AControl specifies the control that takes precedence in alignment when
> other controls have the same Align value. AControl can be nil
>
> Does it mean AControl is Nil when all controls have Align = alNone?

No.

http://wiki.lazarus.freepascal.org/Autosize_/_Layout#TWinControl.AlignControls


> The base method TWinControl.AlignControls is huge, over 700 lines,
> made by "ask".
>
> There is an error in wiki page:
> http://wiki.freepascal.org/Autosize_/_Layout
> which says:
> The layout is applied in the method TWinControl.AlignControls which
> can be overridden. For example TToolBar overrides that and defines a
> flow layout where controls that do not fit are put into subsequent
> lines.
>
> However, TToolBar does not have such method.
> There are only 2 components with overridden AlignControls,
> TScrollingWinControl where it only updates scrollbars, and TControlBar
> where is does nothing yet.

I updated the entry.


> I am thinking how to use it in TControlBar and maybe in TCoolBar.
> As you can see I am not very experienced component writer.

You are working on an unusual one.

Mattias




More information about the Lazarus mailing list