summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-01-10 08:33:22 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-01-10 08:33:22 +0000
commit5bd231fc9fefecd6f8916be29673218c4bd9a9a1 (patch)
tree669302ba3332bce854b343620429f105394ced9c /src
parent42058a5f0bbbdc8f4327559224abb48c968a0cb0 (diff)
downloadfpGUI-5bd231fc9fefecd6f8916be29673218c4bd9a9a1.tar.xz
Applied patch from Vladimir fixing button MouseEnter and MouseExit events.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/gdi/gfx_gdi.pas22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index 3a0c93b7..4892c8bc 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -902,29 +902,29 @@ var
msgp: TfpgMessageParams;
begin
FillChar(msgp, sizeof(msgp), 0);
+ pt.x := LoWord(lParam);
+ pt.y := HiWord(lParam);
if not FMouseInWindow then
begin
- FMouseInWindow := True;
-// Windows.SetCapture(FWinHandle);
-// msgp.mouse.x := LoWord(lParam);
-// msgp.mouse.y := HiWord(lParam);
- fpgSendMessage(nil, AWindow, FPGM_MOUSEENTER, msgp);
+ if {(pt.x > 0) and (pt.y > 0) and (pt.x < Width) and
+ (pt.y < Height) and} not CursorInDifferentWindow then
+ begin
+ FMouseInWindow := True;
+ fpgSendMessage(nil, AWindow, FPGM_MOUSEENTER, msgp);
+ end;
Result := uMsg <> WM_MOUSEMOVE;
end
else
begin
- pt.x := LoWord(lParam);
- pt.y := HiWord(lParam);
if uMsg = WM_MOUSEWHEEL then
Windows.ScreenToClient(FWinHandle, @pt);
// we should change the Width and Height to ClientWidth, ClientHeight
- if (pt.x < 0) or (pt.y < 0) or (pt.x >= Width) or
- (pt.y >= Height) or CursorInDifferentWindow then
+ if {(pt.x < 0) or (pt.y < 0) or (pt.x >= Width) or
+ (pt.y >= Height) or} CursorInDifferentWindow then
FMouseInWindow := False;
- if {(not FHasMouseCapture) and} (not FMouseInWindow) then
+ if (not FMouseInWindow) then
begin
-// Windows.ReleaseCapture;
msgp.mouse.x := LoWord(lParam);
msgp.mouse.y := HiWord(lParam);
fpgSendMessage(nil, AWindow, FPGM_MOUSEEXIT, msgp);