[lazarus] Bug in lcl resizing code and patch for win32

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jun 28 17:32:38 EDT 2003


On Sat, 28 Jun 2003 17:54:25 -0300
Karl Brandt <pascalive at bol.com.br> wrote:

> >That does not explain the WM_MOVE change. The WM_SIZE is defined as such:
> >
> >nWidth = LOWORD(lParam);  // width of client area
> >nHeight = HIWORD(lParam); // height of client area
> >
> >Testing shows that those changes provide the same functionality, only
> >slower.
> >  
> >
> The LParam returns the client Top/Left coordinates that are diferent of 
> window coordinates.
> Try to debug this.
> LCL expects the window coordinates.
> For example: when a control is created with top,left =(0,0) the 
> MoveWindow proc (ResizeChild)  fires WM_SIZE, WM_MOVE messages that are 
> passed in windowproc.
> If you send the client coordinates, that will be a greater than (0,0) 
> let's say (4,24) the LCL will think that you moved the control (the 
> top,left coordinates in LCL are 0,0) and will ask the Interface to move 
> the control, creating that effect we see when we move the form.
> The same occurs with WM_SIZE, but this time you must pass the Client 
> coordinates.
> See yourself: try to pass the WM_SIZE parameters directly to LCL,
> make breakpoints in LM_SETSIZE , Tcontrol.WMSize and WM_SIZE process and 
> inspect the size values

Right.
TCustomForm bounds are the bounds around the client area including the menu.
The menu as a non TControl is *not* on the client area of the form. The
Left, Top of a form is in contrary to Delphi the Left, Top inner edge of the
form border. 


Mattias






More information about the Lazarus mailing list