mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-09 15:57:54 +01:00
TAChart: Add Notification method to TChartListbox.
git-svn-id: trunk@46176 -
This commit is contained in:
parent
dfd57d9ec8
commit
85931626dd
@ -86,6 +86,7 @@ type
|
||||
procedure ClickedItem(AIndex: Integer); virtual;
|
||||
procedure ClickedSeriesIcon(AIndex: Integer); virtual;
|
||||
function CreateLegendItems: TChartLegendItems;
|
||||
procedure Notification(AComponent: TComponent; AOperation: TOperation); override;
|
||||
procedure Populate;
|
||||
|
||||
public
|
||||
@ -457,6 +458,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TChartListbox.Notification(AComponent: TComponent; AOperation: TOperation);
|
||||
begin
|
||||
if (AOperation = opRemove) and (AComponent = FChart) then
|
||||
FChart := nil;
|
||||
inherited Notification(AComponent, AOperation);
|
||||
end;
|
||||
|
||||
procedure TChartListbox.Populate;
|
||||
{ populates the listbox with all series contained in the chart. Use the event
|
||||
OnPopulate if you don't omit special series from the listbox (RemoveSeries) }
|
||||
@ -466,7 +474,7 @@ begin
|
||||
Items.BeginUpdate;
|
||||
try
|
||||
Items.Clear;
|
||||
if FChart = nil then exit;
|
||||
if (FChart = nil) or (FChart.Series = nil) then exit;
|
||||
FreeAndNil(FLegendItems);
|
||||
FLegendItems := CreateLegendItems;
|
||||
Chart.Legend.SortItemsByOrder(FLegendItems);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user