Behavior of LCL Client Area (was: win32 development)

Karl Brandt pascalive at bol.com.br
Tue Sep 24 23:59:43 EDT 2002


Andrew Johnson wrote:

> On Wed, 25 Sep 2002 00:21:59 -0300
> "Karl Brandt "<pascalive at bol.com.br> wrote:
>
>> AFAIK it wasn't applied(i updated cvs today)
>
>
> wierd.. I update daily, and I tried to apply your patch before I wrote 
> that and it told me, already applied do you want to remove... et al. 
> So I assumed it was applied... hrmm.... And all my tests showed proper 
> functionalitly which it didn't before your Patch... I dunno whats up..

I deleted the files and made new update again: the files are without the 
patch :-(

root:=:pserver:cvs at cvs.freepascal.org:/FPC/CVS
repository:=projects/lazarus/lcl/interfaces/win32
entries:=/interfaces.pp/1.7/Sun May 12 20:48:12 2002//
/win32def.pp/1.4/Sun May 12 20:48:12 2002//
/win32listsl.inc/1.6/Sun May 12 20:48:12 2002//
/win32listslh.inc/1.3/Sun May 12 20:48:14 2002//
/win32proc.inc/1.8/Sun May 12 20:48:24 2002//
/winext.pas/1.9/Sun May 12 20:48:28 2002//
/Makefile/1.10/Sun Jul 21 20:35:12 2002//
/Makefile.fpc/1.10/Sun Jul 21 20:35:12 2002//
/win32int.pp/1.16/Sat Aug 24 17:52:52 2002//
/win32winapih.inc/1.14/Thu Sep 12 03:25:08 2002//
/win32winapi.inc/1.19/Wed Sep 25 03:18:02 2002//
/win32callback.inc/1.15/Wed Sep 25 03:52:50 2002//
/win32object.inc/1.25/Wed Sep 25 03:53:14 2002//
D
Do you guess what's wrong?

>
>> What i tried to do was the above (it's not complete!), although i 
>> disagree this way.
>> It looks like the WinControl.ClientHeight/Width act as 
>> WinControl.Height/Width, so setting one or other will do the same thing.
>> Please correct me if i'm wrong
>
>
> This is why I said IF it is implemented properly. I wasn't sure.

I made a simple test and Height = ClientHeight under win32

>
>
>> I think the best behavior is to implement ClientHeight/Width and 
>> Height/Width as Delphi does:
>> If you set the client sizes automatically the correct window sizes 
>> are set and vice-versa,
>> in this manner the lcl user could decide if he wants set the client 
>> or the window size and makes ClientHeight/Width really useful.
>
>
> Yes this is probably how it should be done for Win32

So in win32 would be diferent of gtk?

>
>
>> One way to implement-it:
>> Setting the ClientHeight would calculate the apropriate 
>> (Window)Height via AdjustWindowRectEx (Now it's only a hack-> it 
>> would be done by the interface).
>> Then the Height would be adjusted and the interface called to set the 
>> desired size.
>> The contrary would be true: Height -> ClientHeight
>
>
> makes a sort of sense...
>
>>> This is an incompatibility between X-Windows and Win32 design, not a 
>>> problem in the Lazarus code.
>>
>
>> Is there a way to set the window size instead of client size in gtk?
>> Is there a equivalent Windows.AdjustWindow(Client)RectEx in gtk?
>
>
> This IS the incompatibility.. in XWindows the Border Width Height etc 
> is determined by the window manager, which is a separate program, 
> without any consistant standards or interface library to get this info 
> from. Thus it is Impossible to set the Width/Height in the Win32 
> manner in an XWindows environment, unless you want to try and add 
> support for every known  WM and keep adding more and more support.. 
> AFAIK this is the only way we could make it work... As for the 
> ClientRect, this is what setting Width/Height sets under GTK(except I 
> think under Win32.. but I am not sure)

In other words: there's no way to make client area work as i mentioned 
before in gtk/lazarus :-\






More information about the Lazarus mailing list