From f0b3974618cc80745e0e69f7f49dfeba7919ae5f Mon Sep 17 00:00:00 2001 From: micha Date: Thu, 13 May 2004 12:17:00 +0000 Subject: [PATCH] fixes to designer window mouse/key handling: - capture all events - resizing window on which the overlay is, resizes the overlay too git-svn-id: trunk@5468 - --- lcl/interfaces/win32/win32callback.inc | 13 +++++++++++++ lcl/interfaces/win32/win32winapi.inc | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 0b010a3fc6..557636ad6b 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -131,6 +131,7 @@ Var TheWinControl: TWinControl; WinProcess: Boolean; NotifyUserInput: Boolean; + OverlayWindow: HWND; LMInsertText: TLMInsertText; // used by CB_INSERTSTRING, LB_INSERTSTRING LMScroll: TLMScroll; // used by WM_HSCROLL @@ -907,6 +908,9 @@ Begin exit; TheWinControl.InvalidateClientRectCache(true); end; + OverlayWindow := Windows.GetProp(Window, 'Overlay'); + if OverlayWindow <> 0 then + Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, NewWidth, NewHeight, SWP_NOMOVE); End; End; end; @@ -981,6 +985,10 @@ begin begin Result := 1; end; + WM_KEYFIRST..WM_KEYLAST, WM_MOUSEFIRST..WM_MOUSELAST: + begin + Windows.PostMessage(TWinControl(Windows.GetProp(Window, 'Wincontrol')).Handle, Msg, WParam, LParam); + end; else Result := CallDefaultWindowProc(Window, Msg, WParam, LParam); end; @@ -1147,6 +1155,11 @@ end; { $Log$ + Revision 1.103 2004/05/13 12:17:00 micha + fixes to designer window mouse/key handling: + - capture all events + - resizing window on which the overlay is, resizes the overlay too + Revision 1.102 2004/05/12 15:43:48 micha fix key handling to fire CN_KEYxxx diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index 1d20ec5043..deac52462a 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -1429,7 +1429,7 @@ begin // create 'overlay' window Windows.GetClientRect(WindowHandle, @ARect); OverlayWindow := Windows.CreateWindowEx(WS_EX_TRANSPARENT, - 'STATIC', '', WS_CHILD or WS_VISIBLE, + 'BUTTON', '', WS_CHILD or WS_VISIBLE or BS_OWNERDRAW, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom, WindowHandle, HMENU(nil), HInstance, nil); Windows.SetProp(OverlayWindow, 'DefWndProc', Windows.SetWindowLong( @@ -1437,6 +1437,8 @@ begin Windows.SetProp(OverlayWindow, 'Wincontrol', Windows.GetProp(WindowHandle, 'Wincontrol')); Windows.SetProp(WindowHandle, 'Overlay', OverlayWindow); end; + // bring overlay window to front + Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE); Result := Windows.GetDC(OverlayWindow); end; @@ -2985,6 +2987,11 @@ end; { ============================================================================= $Log$ + Revision 1.110 2004/05/13 12:17:00 micha + fixes to designer window mouse/key handling: + - capture all events + - resizing window on which the overlay is, resizes the overlay too + Revision 1.109 2004/05/13 08:05:57 micha fix translation from lcl to win32 coordinates