mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 22:59:15 +02:00
TAChart: Fix designtime crash when Chart is unlinked from ChartLiveView; add missing Notification method.
This commit is contained in:
parent
61bd692ef5
commit
1a6aea0daa
@ -53,6 +53,7 @@ type
|
|||||||
procedure SetExtentY(const AValue: TChartLiveViewExtentY);
|
procedure SetExtentY(const AValue: TChartLiveViewExtentY);
|
||||||
procedure SetViewportSize(const AValue: Double);
|
procedure SetViewportSize(const AValue: Double);
|
||||||
protected
|
protected
|
||||||
|
procedure Notification(AComponent: TComponent; AOperation: TOperation); override;
|
||||||
procedure UpdateViewport; virtual;
|
procedure UpdateViewport; virtual;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -98,6 +99,16 @@ begin
|
|||||||
UpdateViewport;
|
UpdateViewport;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChartLiveView.Notification(AComponent: TComponent; AOperation: TOperation);
|
||||||
|
begin
|
||||||
|
if (AOperation = opRemove) and (AComponent = FChart) then
|
||||||
|
begin
|
||||||
|
SetActive(false);
|
||||||
|
FChart := nil;
|
||||||
|
end;
|
||||||
|
inherited Notification(AComponent, AOperation);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChartLiveView.RestoreAxisRange(Axis: TChartAxis);
|
procedure TChartLiveView.RestoreAxisRange(Axis: TChartAxis);
|
||||||
begin
|
begin
|
||||||
if Assigned(Axis) then
|
if Assigned(Axis) then
|
||||||
@ -195,6 +206,8 @@ procedure TChartLiveView.StoreAxisRanges;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
if FChart = nil then
|
||||||
|
exit;
|
||||||
SetLength(FAxisRanges, FChart.AxisList.Count);
|
SetLength(FAxisRanges, FChart.AxisList.Count);
|
||||||
for i := 0 to FChart.AxisList.Count-1 do
|
for i := 0 to FChart.AxisList.Count-1 do
|
||||||
StoreAxisRange(FChart.AxisList[i]);
|
StoreAxisRange(FChart.AxisList[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user