diff options
-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; |