From e08abac28c3eecfeec0b3d187f3a149b8e7e80c2 Mon Sep 17 00:00:00 2001 From: ask Date: Sun, 10 Jul 2011 06:14:11 +0000 Subject: [PATCH] TAChart: Update TChartListbox after change of OnPopulate event git-svn-id: trunk@31640 - --- components/tachart/tachartlistbox.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/tachart/tachartlistbox.pas b/components/tachart/tachartlistbox.pas index f25f90f6a0..4a272fd493 100644 --- a/components/tachart/tachartlistbox.pas +++ b/components/tachart/tachartlistbox.pas @@ -63,6 +63,7 @@ type procedure SetChart(AValue: TChart); procedure SetChecked(AIndex: Integer; AValue: Boolean); procedure SetCheckStyle(AValue: TCheckBoxesStyle); + procedure SetOnPopulate(AValue: TNotifyEvent); procedure SetShowCheckboxes(AValue: Boolean); procedure SetShowSeriesIcons(AValue: Boolean); @@ -109,7 +110,7 @@ type read FOnCheckboxClick write FOnCheckboxClick; property OnItemClick: TChartListboxIndexEvent read FOnItemClick write FOnItemClick; - property OnPopulate: TNotifyEvent read FOnPopulate write FOnPopulate; + property OnPopulate: TNotifyEvent read FOnPopulate write SetOnPopulate; property OnSeriesIconClick: TChartListboxIndexEvent read FOnSeriesIconClick write FOnSeriesIconClick; published @@ -535,7 +536,7 @@ begin end; end; -procedure TChartlistbox.SetCheckStyle(AValue: TCheckBoxesStyle); +procedure TChartListbox.SetCheckStyle(AValue: TCheckBoxesStyle); { selects "checkbox" or "radiobutton" styles. In radiobutton mode, only one series can be visible } var @@ -551,6 +552,13 @@ begin Invalidate; end; +procedure TChartListbox.SetOnPopulate(AValue: TNotifyEvent); +begin + if TMethod(FOnPopulate) = TMethod(AValue) then exit; + FOnPopulate := AValue; + Populate; +end; + procedure TChartListbox.SetShowCheckboxes(AValue: Boolean); begin if FShowCheckboxes = AValue then exit;