From 61fe03b5982ad159d91480920f2cddd115c79dcb Mon Sep 17 00:00:00 2001 From: ask Date: Tue, 5 Apr 2011 20:24:28 +0000 Subject: [PATCH] TAChart: Add DrawingBegin/DrawingEnd methods to IChartDrawer git-svn-id: trunk@30205 - --- components/tachart/tadrawutils.pas | 14 ++++++++++++++ components/tachart/tagraph.pas | 2 ++ 2 files changed, 16 insertions(+) diff --git a/components/tachart/tadrawutils.pas b/components/tachart/tadrawutils.pas index eb0e10ec54..0ff8d20709 100644 --- a/components/tachart/tadrawutils.pas +++ b/components/tachart/tadrawutils.pas @@ -69,6 +69,8 @@ type procedure ClippingStart(const AClipRect: TRect); procedure ClippingStart; procedure ClippingStop; + procedure DrawingBegin(const ABoundingBox: TRect); + procedure DrawingEnd; procedure DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer); procedure DrawLineDepth(const AP1, AP2: TPoint; ADepth: Integer); procedure Ellipse(AX1, AY1, AX2, AY2: Integer); @@ -126,6 +128,8 @@ type procedure SimpleTextOut(AX, AY: Integer; const AText: String); virtual; abstract; public constructor Create; + procedure DrawingBegin(const ABoundingBox: TRect); virtual; + procedure DrawingEnd; virtual; procedure DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer); procedure DrawLineDepth(const AP1, AP2: TPoint; ADepth: Integer); procedure LineTo(AX, AY: Integer); virtual; abstract; @@ -276,6 +280,16 @@ begin FGetFontOrientationFunc := @DummyGetFontOrientationFunc; end; +procedure TBasicDrawer.DrawingBegin(const ABoundingBox: TRect); +begin + Unused(ABoundingBox); +end; + +procedure TBasicDrawer.DrawingEnd; +begin + // Empty +end; + procedure TBasicDrawer.DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer); begin DrawLineDepth(Point(AX1, AY1), Point(AX2, AY2), ADepth); diff --git a/components/tachart/tagraph.pas b/components/tachart/tagraph.pas index 714bd970fa..03604153ce 100644 --- a/components/tachart/tagraph.pas +++ b/components/tachart/tagraph.pas @@ -677,6 +677,7 @@ var legendItems: TChartLegendItems = nil; legendRect: TRect; begin + ADrawer.DrawingBegin(ARect); Clear(ADrawer, ARect); FClipRect := ARect; @@ -719,6 +720,7 @@ begin OnExtentChanged(Self); FPrevLogicalExtent := FLogicalExtent; end; + ADrawer.DrawingEnd; end; procedure TChart.DrawBackWall(ADrawer: IChartDrawer);