TAChart: Fix MouseUp event dispatch for tools

git-svn-id: trunk@32024 -
This commit is contained in:
ask 2011-08-21 08:58:57 +00:00
parent 2411bc6d12
commit 9835faabb1

View File

@ -257,7 +257,7 @@ type
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
AButton: TMouseButton; AShift: TShiftState; AX, AY: Integer); override;
{$IFDEF LCLGtk2}
procedure DoOnResize; override;
{$ENDIF}
@ -1066,9 +1066,15 @@ begin
inherited;
end;
procedure TChart.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure TChart.MouseUp(
AButton: TMouseButton; AShift: TShiftState; AX, AY: Integer);
const
MOUSE_BUTTON_TO_SHIFT: array [TMouseButton] of TShiftStateEnum = (
ssLeft, ssRight, ssMiddle, ssExtra1, ssExtra2);
begin
if GetToolset.Dispatch(Self, evidMouseUp, Shift, Point(X, Y)) then exit;
// To find a tool, toolset must see the shift state with the button still down.
Include(AShift, MOUSE_BUTTON_TO_SHIFT[AButton]);
if GetToolset.Dispatch(Self, evidMouseUp, AShift, Point(AX, AY)) then exit;
inherited;
end;