mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 08:40:42 +01:00
TAChart: Unassign tool's chart reference during deactivation.
This fixes issue #17507 git-svn-id: trunk@27571 -
This commit is contained in:
parent
e7ce0b0dac
commit
11c20399c2
@ -1211,6 +1211,7 @@ procedure TBasicChartTool.Deactivate;
|
|||||||
begin
|
begin
|
||||||
FChart.MouseCapture := false;
|
FChart.MouseCapture := false;
|
||||||
FChart.FActiveToolIndex := -1;
|
FChart.FActiveToolIndex := -1;
|
||||||
|
FChart := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SkipObsoleteChartProperties;
|
procedure SkipObsoleteChartProperties;
|
||||||
|
|||||||
@ -464,24 +464,19 @@ var
|
|||||||
begin
|
begin
|
||||||
if not Enabled or (FChart <> nil) and (FChart <> AChart) then exit;
|
if not Enabled or (FChart <> nil) and (FChart <> AChart) then exit;
|
||||||
FChart := AChart;
|
FChart := AChart;
|
||||||
try
|
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
|
||||||
ev := FMouseEvents[Ord(AEventId) + Ord(High(AEventId)) + 1];
|
if Assigned(ev) then begin
|
||||||
if Assigned(ev) then begin
|
ev(Self, APoint);
|
||||||
ev(Self, APoint);
|
if Toolset.FIsHandled then exit;
|
||||||
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;
|
|
||||||
end;
|
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;
|
end;
|
||||||
|
|
||||||
function TChartTool.GetIndex: Integer;
|
function TChartTool.GetIndex: Integer;
|
||||||
@ -686,12 +681,12 @@ end;
|
|||||||
procedure TBasicZoomTool.DoZoom(const ANewExtent: TDoubleRect; AFull: Boolean);
|
procedure TBasicZoomTool.DoZoom(const ANewExtent: TDoubleRect; AFull: Boolean);
|
||||||
begin
|
begin
|
||||||
if (AnimationInterval = 0) or (AnimationSteps = 0) then begin
|
if (AnimationInterval = 0) or (AnimationSteps = 0) then begin
|
||||||
if IsActive then
|
|
||||||
Deactivate;
|
|
||||||
if AFull then
|
if AFull then
|
||||||
FChart.ZoomFull
|
FChart.ZoomFull
|
||||||
else
|
else
|
||||||
FChart.LogicalExtent := ANewExtent;
|
FChart.LogicalExtent := ANewExtent;
|
||||||
|
if IsActive then
|
||||||
|
Deactivate;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if not IsActive then
|
if not IsActive then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user