[lazarus] Bug in lcl resizing code and patch for win32
Mattias Gaertner
nc-gaertnma at netcologne.de
Sat Jun 28 17:23:38 EDT 2003
On Sat, 28 Jun 2003 22:07:52 +0200
"Micha Nelissen" <mdvpost at hotmail.com> wrote:
> Mattias Gaertner wrote:
> > On Sat, 28 Jun 2003 21:45:04 +0200
> > "Micha Nelissen" <mdvpost at hotmail.com> wrote:
> >
> >> Karl Brandt wrote:
> >>> Micha Nelissen wrote:
> >>>
> >>>> Karl Brandt wrote:
> >>>>
> >>>>
> >>>>> Sometime ago i sent a patch fixing the forms sizes under win32 and
> >>>>> got surprised to see that things were messed.
> >>>>> So i did the job again!
> >>>>>
> >>>>> Attached is a patch that makes the form sizes correct.
> >>>>>
> >>>>>
> >>>>
> >>>> What was wrong? Those messages should send the same information as
> >>>> you retrieve via GetClientRect/GetWindowRect.
> >>>>
> >>>>
> >>> In LCL, WindowSize = ClientSize while windows and VCL expect/returns
> >>> diferent sizes, so is needed some adjustments.
> >>
> >> 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
> >
> > Ehh. At the moment the LCL thinks that WM_SIZE contains the bounds of
> > a control. The ClientArea can be smaller (TGroupBox, TForm with a
> > menu) or in some cases bigger (TScrollBox).
>
> ?? In TControl.WMSize it tries to do SetBounds with the Width and Height
> parameters...SetBounds in the LCL is defined as clientwidth and height,
> no?
No. SetBounds sets the bounds.
> Where and how is the difference made between ClientHeight and Height and
> ClientWidth and Width?
There is a big difference and it is even bigger in the gtk-interface.
The clientarea is the area for the childs. In most cases this corresponds to
the bounds minus the frame and the scrollbars. A TControl has no childs and
so it defines the clientarea = bounds. TWinControl redefines the client
area.
The VCL does not always distinguish cleanly between clientarea and bounds.
But under gtk a control can consist of several widgets and so the LCL must
distinguish between them more carefully.
I'm now able to cross compile for win32 and started to improve the IDE for
cross development. Cross 'Find Declaration' and code completion already
works. The next step is remote debugging.
Mattias
More information about the Lazarus
mailing list