TTeeCanvas.AssignBrush overloads are incorrect
Posted: Mon Feb 13, 2012 9:42 pm
When trying to use TSeriesBandTool, we noted that the colour of the band was incorrect compared with previous versions of TeeChart. We traced this to the TTeeCanvas.AssignBrush overloads, which swap BackColor and Color. These overloaded functions are used in many places, some correctly, some incorrectly; it's quite inconsistent.
CandleCh: used correctly, but will fail
ErrorBar: used correctly, but will fail
Series: used correctly, but will fail
StatChar: used correctly, but will fail
TeeArrowTool: used correctly, but will fail
TeeAxisBreaks: used correctly, but will fail
TeeCircularGauge: incorrect?
TeeClusteringTool: used correctly, but will fail
TeeFrameTool: used correctly, but will fail
TeeFunnel: unsure?
TeeGridBandToolEdit: ok
TeeLegendScrollBar: used correctly, but will fail
TeeLinearGauge: used correctly, but will fail
TeeMapSeries: used correctly, but will fail
TeEngine: incorrect?
TeePolar: used correctly, but will fail
TeeProcs: unsure?
TeeRenkoSeries: unsure?
TeeRose: unsure?
TeeSelectorTool: incorrect?
TeeSeriesBandTool: used correctly, but will fail
TeeSeriesRegion: used correctly, but will fail
TeeShape: used correctly, but will fail
TeeSurfa: used correctly, but will fail?
TeeTagCloud: used correctly, but will fail
TeeText3D: used correctly, but will fail
TeeTools: used correctly, but will fail
TeeTriSurface: used correctly, but will fail
TeeVolumePipe: incorrect?
The following units use AssignBrush in various ways. There seems to be a real lack of consistency among them. It's not clear to me when the intent is to use BackColor and when the intent is to use Color, in many circumstances, but you'll be clearer on that. A brief review of them yielded:Procedure TTeeCanvas.AssignBrush(ABrush:TChartBrush);
begin
AssignBrush(ABrush,ABrush.BackColor,ABrush.Color);
end;
Procedure TTeeCanvas.AssignBrush(ABrush:TChartBrush; ABackColor:TColor);
begin
AssignBrush(ABrush,ABackColor,ABrush.Color);
end;
(snip)
// deprecated, please use AssignBrush
Procedure TTeeCanvas.AssignBrushColor(ABrush:TChartBrush; AColor,ABackColor:TColor); // deprecated;
begin
AssignBrush(ABrush,AColor,ABackColor);
end;
Procedure TTeeCanvas.AssignBrush(ABrush:TChartBrush; AColor,ABackColor:TColor);
CandleCh: used correctly, but will fail
ErrorBar: used correctly, but will fail
Series: used correctly, but will fail
StatChar: used correctly, but will fail
TeeArrowTool: used correctly, but will fail
TeeAxisBreaks: used correctly, but will fail
TeeCircularGauge: incorrect?
TeeClusteringTool: used correctly, but will fail
TeeFrameTool: used correctly, but will fail
TeeFunnel: unsure?
TeeGridBandToolEdit: ok
TeeLegendScrollBar: used correctly, but will fail
TeeLinearGauge: used correctly, but will fail
TeeMapSeries: used correctly, but will fail
TeEngine: incorrect?
TeePolar: used correctly, but will fail
TeeProcs: unsure?
TeeRenkoSeries: unsure?
TeeRose: unsure?
TeeSelectorTool: incorrect?
TeeSeriesBandTool: used correctly, but will fail
TeeSeriesRegion: used correctly, but will fail
TeeShape: used correctly, but will fail
TeeSurfa: used correctly, but will fail?
TeeTagCloud: used correctly, but will fail
TeeText3D: used correctly, but will fail
TeeTools: used correctly, but will fail
TeeTriSurface: used correctly, but will fail
TeeVolumePipe: incorrect?