diff --git a/components/tachart/tastyles.pas b/components/tachart/tastyles.pas index 8ed0868be1..f764a6ab6c 100644 --- a/components/tachart/tastyles.pas +++ b/components/tachart/tastyles.pas @@ -58,6 +58,12 @@ type TChartStyles = class; + TChartStyleEnumerator = class(TCollectionEnumerator) + public + function GetCurrent: TChartStyle; + property Current: TChartStyle read GetCurrent; + end; + { TChartStyleList } TChartStyleList = class(TCollection) @@ -69,6 +75,7 @@ type function GetOwner: TPersistent; override; public constructor Create(AOwner: TChartStyles); + function GetEnumerator: TChartStyleEnumerator; inline; property Style[AIndex: Integer]: TChartStyle read GetStyle; default; end; @@ -99,6 +106,13 @@ begin RegisterComponents(CHART_COMPONENT_IDE_PAGE, [TChartStyles]); end; +{ TChartStyleEnumerator } + +function TChartStyleEnumerator.GetCurrent: TChartStyle; +begin + Result := TChartStyle(inherited GetCurrent); +end; + { TChartStyle } procedure TChartStyle.Apply(ADrawer: IChartDrawer); @@ -195,6 +209,11 @@ begin FOwner := AOwner; end; +function TChartStyleList.GetEnumerator: TChartStyleEnumerator; +begin + Result := TChartStyleEnumerator.Create(Self); +end; + function TChartStyleList.GetOwner: TPersistent; begin Result := FOwner;