Sign in Join

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

Mailing lists / lazarus / 2003-06

LCL - Window sizing

2 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: Could somebody explain me the sizing mechanism in the LCL? I can't figure out how it…
Show quoted text 6 lines
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

Reply by email

Micha Nelissen

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.

Thanks,

Micha.

Reply by email