diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-21 18:20:20 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-21 18:20:20 +0000 |
commit | 7fa36a99aa445bde5cbb9435d34ba1e400dd9413 (patch) | |
tree | 1a1aa27a47d0df98928641a8c640b5f76029b366 /src | |
parent | 860a90b965388ea400b40892e4ae574a2667fbd3 (diff) | |
download | fpGUI-7fa36a99aa445bde5cbb9435d34ba1e400dd9413.tar.xz |
* GDI: Oops. The previous revision broke left click. Now fixed.
* After a Double Click event occurs, the Mouse Up event also occurs. The previous revision did not
let the Mouse Up fire, which was wrong.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 4 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 14 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index 673ecff1..d0bcc846 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -517,9 +517,9 @@ begin end; WM_LBUTTONDOWN, - WM_LBUTTONUP, + WM_LBUTTONUP: //WM_LBUTTONDBLCLK: - //msgp.mouse.Buttons := MOUSE_LEFT; + msgp.mouse.Buttons := MOUSE_LEFT; WM_RBUTTONDOWN, WM_RBUTTONUP: diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 2b454e80..9e9021f8 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -313,7 +313,6 @@ procedure TfpgWidget.MsgMouseUp(var msg: TfpgMessageRec); var mb: TMouseButton; IsDblClick: boolean; - t: DWord; begin if not FEnabled then exit; // Do we want this here? @@ -324,23 +323,20 @@ begin MOUSE_LEFT: begin mb := mbLeft; - t := fpgGetTickCount - uLastClickTime; -// writeln('diff: ', t, ' DoubleClick_MS:', DOUBLECLICK_MS); if uLastClickWidget = self then - IsDblClick := (t) <= DOUBLECLICK_MS // we detected a double click + IsDblClick := (fpgGetTickCount - uLastClickTime) <= DOUBLECLICK_MS // we detected a double click else uLastClickWidget := self; uLastClickTime := fpgGetTickCount; -// Writeln('IsDblClick: ', IsDblClick); if IsDblClick then begin HandleDoubleClick(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.Buttons, msg.Params.mouse.shiftstate); if Assigned(FOnDoubleClick) then FOnDoubleClick(self, mb, msg.Params.mouse.shiftstate, Point(msg.Params.mouse.x, msg.Params.mouse.y)); - end - else - HandleLMouseUp(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.shiftstate); + end; + // The mouse up must still be handled even if we had a double click event. + HandleLMouseUp(msg.Params.mouse.x, msg.Params.mouse.y, msg.Params.mouse.shiftstate); end; MOUSE_RIGHT: begin @@ -352,7 +348,7 @@ begin mb := mbMiddle; end; end; - if Assigned(FOnMouseUp) and not IsDblClick then + if Assigned(FOnMouseUp) then // and not IsDblClick then FOnMouseUp(self, mb, msg.Params.mouse.shiftstate, Point(msg.Params.mouse.x, msg.Params.mouse.y)); end; |