[lazarus] LCL - Window sizing

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jun 27 13:10:36 EDT 2003


On Fri, 27 Jun 2003 16:50:13 +0200
"Micha Nelissen" <mdvpost at hotmail.com> wrote:

> Hi,
> 
> Could somebody explain me the sizing mechanism in the LCL? I can't figure
> out how it works, ie. I set Form1.Height := 300; What happens? I am
> particularly interested in the messages sent to the interface that do the
> actual job, so to say.

The LCL sends LM_SETSIZE messages to the interface in
TWinControl.InitializeWnd and TWinControl.RealizeBounds. The InitializeWnd
is called at the end of the handle creation, right before the LM_SHOWHIDE
message. The TWinControl.RealizeBounds is called whenever the LCL is ready
to commit. That means it does not send LM_SETSIZE messages during loading,
or the handle is not created, or while autosizing, or it already sent a size
message with the current bounds. The LCL therefore sends less size messages
than the VCL. 

A Form1.Height:=300; first changes the width of the LCL control, without
sending a message. Then the autosizing is invoked (align, anchors,
constraints). If this changes the bounds the LM_SETSIZE message is sent.


Mattias







More information about the Lazarus mailing list