From cccff36a953779af65c9eaf18115bdb9e42fa93d Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 4 Jul 2003 17:46:27 +0000 Subject: [PATCH] fixed notebook positioning from Micha git-svn-id: trunk@4369 - --- lcl/interfaces/win32/win32object.inc | 14 ++++++++------ lcl/interfaces/win32/win32winapi.inc | 11 ++++++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index 8d49759402..1b87a1b534 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -636,6 +636,8 @@ activate_time : the time at which the activation event occurred. begin Windows.GetClientRect((Sender As TWinControl).Parent.Handle,@R); Windows.SendMessage((Sender As TWinControl).Parent.Handle, TCM_AdjustRect, 0, LPARAM(@R)); + Left := R.Left; + Top := R.Top; end end; R := Rect(Left, Top, R.Right - R.Left, R.Bottom - R.Top); @@ -1716,10 +1718,7 @@ Begin If (Sender Is TWinControl) And ((Sender As TWinControl).Parent <> Nil) Then Begin Assert(False, Format('Trace:TWin32Object.CreateComponent - %S parent --> %S', [Sender.ClassName, TWinControl(Sender).Parent.ClassName])); - If Not ((Sender As TWinControl).Parent Is TPage) Then - Parent := (Sender As TWinControl).Parent.Handle - Else - Parent :=((Sender As TWinControl).Parent As TPage).Parent.Handle; + Parent := (Sender As TWinControl).Parent.Handle; Assert(False, Format('Trace:TWin32Object.CreateComponent - parent handle --> 0x%X', [Parent])); Assert(False, 'Trace:Setting parent'); @@ -1891,7 +1890,7 @@ Begin Begin Assert(False, 'Trace:CreateComponent - Creating a Form Window'); try - Window := CreateWindow(ClsName, StrTemp, WS_OVERLAPPEDWINDOW or WS_CLIPSIBLINGS or WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, Parent, HMENU(Nil), HInstance, Nil); + Window := CreateWindow(ClsName, StrTemp, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, Parent, HMENU(Nil), HInstance, Nil); except writeln('Exception occured creating window'); end; @@ -2087,7 +2086,7 @@ Begin csPage: Begin Assert(False, 'Trace:Create a csPage component.'); - Window := CreateWindowEx(WS_EX_CONTROLPARENT, @ClsName, Nil, WS_CHILD or WS_CLIPCHILDREN or WS_CLIPSIBLINGS, Left, Top, Width, Height, Parent, HMENU(Nil), HInstance, Nil); + Window := CreateWindowEx(WS_EX_CONTROLPARENT, @ClsName, Nil, Flags and not WS_VISIBLE, Left, Top, Width, Height, Parent, HMENU(Nil), HInstance, Nil); ShowWindow(Window, SW_HIDE); SetProp(Window, 'Lazarus', Sender); DoSubClass := false; @@ -2745,6 +2744,9 @@ End; { $Log$ + Revision 1.74 2003/07/04 17:46:27 mattias + fixed notebook positioning from Micha + Revision 1.73 2003/07/04 11:12:27 mattias improved default handler from Micha diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index 8fac6b4c37..abdeffc620 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -139,13 +139,15 @@ End; functions for the message. ------------------------------------------------------------------------------} Procedure TWin32Object.CallDefaultWndHandler(Sender: TObject; var Message); +var + Handle: HWND; begin + Handle := ObjectToHwnd(Sender); case TLMessage(Message).Msg of LM_PAINT: - begin - Result := CallWindowProc(GetProp(Handle, 'DefWndProc'), Handle, WM_PAINT, Message.WParam, Message.LParam); - end; + CallWindowProc(GetProp(Handle, 'DefWndProc'), Handle, WM_PAINT, + TLMessage(Message).WParam, TLMessage(Message).LParam); end; end; @@ -2336,6 +2338,9 @@ end; { ============================================================================= $Log$ + Revision 1.43 2003/07/04 17:46:27 mattias + fixed notebook positioning from Micha + Revision 1.42 2003/07/04 11:12:27 mattias improved default handler from Micha