TAChart: Unassign tool's chart reference during deactivation.

This fixes issue #17507

git-svn-id: trunk@27571 -
This commit is contained in:
ask 2010-10-04 11:56:50 +00:00
parent e7ce0b0dac
commit 11c20399c2
2 changed files with 15 additions and 19 deletions

View File

@ -1211,6 +1211,7 @@ procedure TBasicChartTool.Deactivate;
begin
FChart.MouseCapture := false;
FChart.FActiveToolIndex := -1;
FChart := nil;
end;
procedure SkipObsoleteChartProperties;

View File

@ -464,24 +464,19 @@ var
begin
if not Enabled or (FChart <> nil) and (FChart <> AChart) then exit;
FChart := AChart;
try
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
if Assigned(ev) then begin
ev(Self, APoint);
if Toolset.FIsHandled then exit;
end;
case AEventId of
evidMouseDown: MouseDown(APoint);
evidMouseMove: MouseMove(APoint);
evidMouseUp : MouseUp (APoint);
end;
ev := FMouseEvents[Ord(AEventId)];
if Assigned(ev) then
ev(Self, APoint);
finally
if not IsActive then
FChart := nil;
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
if Assigned(ev) then begin
ev(Self, APoint);
if Toolset.FIsHandled then exit;
end;
case AEventId of
evidMouseDown: MouseDown(APoint);
evidMouseMove: MouseMove(APoint);
evidMouseUp : MouseUp (APoint);
end;
ev := FMouseEvents[Ord(AEventId)];
if Assigned(ev) then
ev(Self, APoint);
end;
function TChartTool.GetIndex: Integer;
@ -686,12 +681,12 @@ end;
procedure TBasicZoomTool.DoZoom(const ANewExtent: TDoubleRect; AFull: Boolean);
begin
if (AnimationInterval = 0) or (AnimationSteps = 0) then begin
if IsActive then
Deactivate;
if AFull then
FChart.ZoomFull
else
FChart.LogicalExtent := ANewExtent;
if IsActive then
Deactivate;
exit;
end;
if not IsActive then