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 -
This commit is contained in:
micha 2004-05-13 12:17:00 +00:00
parent ae0fc2b516
commit f0b3974618
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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