mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:19:19 +02:00
TAChart: Update TColorMapSeries after ColorSource change
git-svn-id: trunk@29325 -
This commit is contained in:
parent
e0eacbebbd
commit
45aa6e748e
@ -99,6 +99,7 @@ type
|
||||
private
|
||||
FBrush: TBrush;
|
||||
FColorSource: TCustomChartSource;
|
||||
FColorSourceListener: TListener;
|
||||
FInterpolate: Boolean;
|
||||
FOnCalculate: TFuncCalculate3DEvent;
|
||||
FStepX: TFuncSeriesStep;
|
||||
@ -406,6 +407,7 @@ end;
|
||||
constructor TColorMapSeries.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FColorSourceListener := TListener.Create(@FColorSource, @StyleChanged);
|
||||
FBrush := TBrush.Create;
|
||||
FBrush.OnChange := @StyleChanged;
|
||||
FStepX := DEF_COLORMAP_STEP;
|
||||
@ -414,6 +416,7 @@ end;
|
||||
|
||||
destructor TColorMapSeries.Destroy;
|
||||
begin
|
||||
FreeAndNil(FColorSourceListener);
|
||||
FreeAndNil(FBrush);
|
||||
inherited Destroy;
|
||||
end;
|
||||
@ -524,7 +527,10 @@ end;
|
||||
procedure TColorMapSeries.SetColorSource(AValue: TCustomChartSource);
|
||||
begin
|
||||
if FColorSource = AValue then exit;
|
||||
if FColorSourceListener.IsListening then
|
||||
ColorSource.Broadcaster.Unsubscribe(FColorSourceListener);
|
||||
FColorSource := AValue;
|
||||
ColorSource.Broadcaster.Subscribe(FColorSourceListener);
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user