TAChart: Remove old deprecated code.

git-svn-id: trunk@59230 -
This commit is contained in:
wp 2018-10-02 20:34:45 +00:00
parent fc85354010
commit a1b87dac3d
8 changed files with 43 additions and 58 deletions

View File

@ -108,6 +108,8 @@ procedure splineparameters
implementation implementation
uses
Math;
procedure ipffsn(n: ArbInt; var x, y, a, d2a: ArbFloat; var term: ArbInt); procedure ipffsn(n: ArbInt; var x, y, a, d2a: ArbFloat; var term: ArbInt);
@ -233,7 +235,7 @@ var i, sr, n1s, ns1, ns2: ArbInt;
c:=a; fc:=fa; x:=b c:=a; fc:=fa; x:=b
end; end;
k:=0; k:=0;
tol:=ae+re*spemax(abs(a), abs(b)); tol:=ae+re*max(abs(a), abs(b));
w1:=abs(b-a); stop:=false; w1:=abs(b-a); stop:=false;
while (abs(b-a)>tol) and (fb<>0) and (not stop) do while (abs(b-a)>tol) and (fb<>0) and (not stop) do
begin begin
@ -246,8 +248,8 @@ var i, sr, n1s, ns1, ns2: ArbInt;
x:=(b*fc-c*fb)/(fc-fb); x:=(b*fc-c*fb)/(fc-fb);
if abs(b-x)<tol if abs(b-x)<tol
then then
x:=b-tol*spesgn(b-a); x:=b-tol*sign(b-a);
if spesgn(x-m)=spesgn(x-b) if sign(x-m)=sign(x-b)
then then
x:=m x:=m
end; end;
@ -255,7 +257,7 @@ var i, sr, n1s, ns1, ns2: ArbInt;
if term=2 if term=2
then then
exit; exit;
if spesgn(fa)*spesgn(fb)>0 if sign(fa)*sign(fb)>0
then then
begin begin
a:=c; fa:=fc; k:=0 a:=c; fa:=fc; k:=0
@ -267,7 +269,7 @@ var i, sr, n1s, ns1, ns2: ArbInt;
begin begin
c:=b; fc:=fb; x:=a; b:=a; fb:=fa; a:=c; fa:=fc; k:=0 c:=b; fc:=fb; x:=a; b:=a; fb:=fa; a:=c; fa:=fc; k:=0
end; end;
tol:=ae+re*spemax(abs(a), abs(b)); tol:=ae+re*max(abs(a), abs(b));
w2:=abs(b-a); w2:=abs(b-a);
if w2>=w1 if w2>=w1
then then

View File

@ -53,8 +53,6 @@ type
published published
property Caption: String read FCaption write SetCaption; property Caption: String read FCaption write SetCaption;
property Distance default DEF_TITLE_DISTANCE; property Distance default DEF_TITLE_DISTANCE;
// Use LabelFont instead.
property Font: TFont read GetFont write SetFont stored false; deprecated;
property Frame; property Frame;
property LabelBrush; property LabelBrush;
property PositionOnMarks: Boolean property PositionOnMarks: Boolean
@ -276,7 +274,7 @@ type
implementation implementation
uses uses
Math, SysUtils, Math, SysUtils, LResources,
TAGeometry, TAMath; TAGeometry, TAMath;
{ TChartMinorAxisMarks } { TChartMinorAxisMarks }
@ -789,4 +787,14 @@ begin
AIndex += 1; AIndex += 1;
end; end;
procedure SkipObsoleteProperties;
const
FONT_NOTE = 'Obsolete, use ChartTitle.LabelFont instead';
begin
RegisterPropertyToSkip(TChartAxisTitle, 'Font', FONT_NOTE, '');
end;
initialization
SkipObsoleteProperties;
end. end.

View File

@ -348,7 +348,8 @@ type
implementation implementation
uses uses
Math, PropEdits, StrUtils, TAGeometry, TAMath, Types; Math, PropEdits, StrUtils, LResources, Types,
TAGeometry, TAMath;
function CreateLazIntfImage( function CreateLazIntfImage(
out ARawImage: TRawImage; const ASize: TPoint): TLazIntfImage; out ARawImage: TRawImage; const ASize: TPoint): TLazIntfImage;
@ -1794,10 +1795,10 @@ begin
end; end;
procedure SkipObsoleteProperties; procedure SkipObsoleteProperties;
const
LEGEND_NOTE = 'Obsolete, use TCustomChartSeries.ShowInLegend instead';
begin begin
RegisterPropertyEditor( RegisterPropertyToSkip(TCustomChartSeries, 'ShowInLegend', LEGEND_NOTE, '');
TypeInfo(Boolean), TCustomChartSeries,
'ShowInLegend', THiddenPropertyEditor);
end; end;
initialization initialization

View File

@ -348,9 +348,6 @@ type
procedure GetLowerPredictionInterval(const Ax: Double; out AY: Double); procedure GetLowerPredictionInterval(const Ax: Double; out AY: Double);
procedure GetUpperPredictionInterval(const Ax: Double; out AY: Double); procedure GetUpperPredictionInterval(const Ax: Double; out AY: Double);
{$IFEND} {$IFEND}
function GetFitEquationString(
ANumFormat: String; AXText: String = 'x'; AYText: String = 'y'): String;
deprecated 'Use EquationText';
function GetNearestPoint( function GetNearestPoint(
const AParams: TNearestPointParams; const AParams: TNearestPointParams;
out AResults: TNearestPointResults): Boolean; override; out AResults: TNearestPointResults): Boolean; override;
@ -482,14 +479,12 @@ type
read FOnCalculate write SetOnCalculate; read FOnCalculate write SetOnCalculate;
end; end;
// Builds an equation string based on the parameters and the type of equation. // Builds an equation string based on the parameters and the type of equation.
// AXText and AYText are placeholders for the x and y variables, respectively. // AXText and AYText are placeholders for the x and y variables, respectively.
// Parameters are formatted by passing ANumFormat to the "Format" function. // Parameters are formatted by passing ANumFormat to the "Format" function.
function ParamsToEquation( function ParamsToEquation(
AEquation: TFitEquation; const AParams: array of Double; AEquation: TFitEquation; const AParams: array of Double;
ANumFormat: String; AXText: String = 'x'; AYText: String = 'y'): String; ANumFormat: String; AXText: String = 'x'; AYText: String = 'y'): String;
deprecated 'Use IFitEquationText';
implementation implementation
@ -1785,11 +1780,13 @@ begin
end; end;
{$IFEND} {$IFEND}
{ Function removed, but left here commented to show useage of IEquationText.
function TFitSeries.GetFitEquationString(ANumFormat: String; AXText: String; function TFitSeries.GetFitEquationString(ANumFormat: String; AXText: String;
AYText: String): String; AYText: String): String;
begin begin
Result := EquationText.NumFormat(ANumFormat).X(AXText).Y(AYText); Result := EquationText.NumFormat(ANumFormat).X(AXText).Y(AYText);
end; end;
}
procedure TFitSeries.GetLegendItems(AItems: TChartLegendItems); procedure TFitSeries.GetLegendItems(AItems: TChartLegendItems);
var var

View File

@ -333,7 +333,6 @@ type
public // Helpers for series drawing public // Helpers for series drawing
procedure DrawLineHoriz(ADrawer: IChartDrawer; AY: Integer); procedure DrawLineHoriz(ADrawer: IChartDrawer; AY: Integer);
procedure DrawLineVert(ADrawer: IChartDrawer; AX: Integer); procedure DrawLineVert(ADrawer: IChartDrawer; AX: Integer);
procedure DrawOnCanvas(Rect: TRect; ACanvas: TCanvas); deprecated;
function IsPointInViewPort(const AP: TDoublePoint): Boolean; function IsPointInViewPort(const AP: TDoublePoint): Boolean;
public public
@ -1030,11 +1029,6 @@ begin
ADrawer.Line(AX, FClipRect.Top, AX, FClipRect.Bottom); ADrawer.Line(AX, FClipRect.Top, AX, FClipRect.Bottom);
end; end;
procedure TChart.DrawOnCanvas(Rect: TRect; ACanvas: TCanvas);
begin
PaintOnCanvas(ACanvas, Rect);
end;
procedure TChart.DrawReticule(ADrawer: IChartDrawer); procedure TChart.DrawReticule(ADrawer: IChartDrawer);
begin begin
ADrawer.SetXor(true); ADrawer.SetXor(true);

View File

@ -235,8 +235,6 @@ type
property Inverted: Boolean read FInverted write SetInverted default false; property Inverted: Boolean read FInverted write SetInverted default false;
property ItemFillOrder: TLegendItemFillOrder property ItemFillOrder: TLegendItemFillOrder
read FItemFillOrder write SetItemFillOrder default lfoColRow; read FItemFillOrder write SetItemFillOrder default lfoColRow;
property Margin: TChartDistance
read FMarginX write SetMargin stored false; deprecated;
property MarginX: TChartDistance property MarginX: TChartDistance
read FMarginX write SetMarginX default DEF_LEGEND_MARGIN; read FMarginX write SetMarginX default DEF_LEGEND_MARGIN;
property MarginY: TChartDistance property MarginY: TChartDistance
@ -307,7 +305,8 @@ type
implementation implementation
uses uses
Math, PropEdits, Types, TADrawerCanvas, TAGeometry; Math, PropEdits, Types, LResources,
TADrawerCanvas, TAGeometry;
const const
SYMBOL_TEXT_SPACING = 4; SYMBOL_TEXT_SPACING = 4;
@ -1032,9 +1031,10 @@ begin
end; end;
procedure SkipObsoleteProperties; procedure SkipObsoleteProperties;
const
MARGIN_NOTE = 'Obsolete, use Legend.MarginX instead';
begin begin
RegisterPropertyEditor( RegisterPropertyToSkip(TChartLegend, 'Margin', MARGIN_NOTE, '');
TypeInfo(TChartDistance), TChartLegend, 'Margin', THiddenPropertyEditor);
end; end;
initialization initialization

View File

@ -246,16 +246,10 @@ type
property XErrorBars; property XErrorBars;
property YErrorBars; property YErrorBars;
// Events // Events
property OnDrawPointer: TSeriesPointerDrawEvent
read FOnDrawPointer write FOnDrawPointer; deprecated 'Use OnCustomDrawPointer';
property OnCustomDrawPointer; property OnCustomDrawPointer;
property OnGetPointerStyle; property OnGetPointerStyle;
end; end;
// 'TSerie' alias is for compatibility with older versions of TAChart.
// Use TLineSeries instead.
TSerie = TLineSeries deprecated;
// Scatter plot displaying a single pixel per data point. // Scatter plot displaying a single pixel per data point.
// Optimized to work efficiently for millions of points. // Optimized to work efficiently for millions of points.
// See http://en.wikipedia.org/wiki/Manhattan_plot // See http://en.wikipedia.org/wiki/Manhattan_plot
@ -334,10 +328,6 @@ type
property ZPosition; property ZPosition;
end; end;
// 'TLine' alias is for compatibility with older versions of TAChart.
// Use TConstantLine instead.
TLine = class(TConstantLine) end deprecated;
TSeriesDrawEvent = procedure (ACanvas: TCanvas; const ARect: TRect) of object; TSeriesDrawEvent = procedure (ACanvas: TCanvas; const ARect: TRect) of object;
TSeriesGetBoundsEvent = procedure (var ABounds: TDoubleRect) of object; TSeriesGetBoundsEvent = procedure (var ABounds: TDoubleRect) of object;
@ -1824,13 +1814,13 @@ end;
procedure SkipObsoleteProperties; procedure SkipObsoleteProperties;
const const
STAIRS_NOTE = 'Obsolete, use ConnectType instead'; STAIRS_NOTE = 'Obsolete, use ConnectType instead';
DRAWPOINTER_NOTE = 'Obsolete, use OnCustomDrawPointer instead';
begin begin
RegisterPropertyEditor(
TypeInfo(Boolean), TLineSeries, 'ShowLines', THiddenPropertyEditor);
RegisterPropertyEditor( RegisterPropertyEditor(
TypeInfo(TChartAxisIndex), TConstantLine, 'AxisIndexX', THiddenPropertyEditor); TypeInfo(TChartAxisIndex), TConstantLine, 'AxisIndexX', THiddenPropertyEditor);
RegisterPropertyToSkip(TAreaSeries, 'Stairs', STAIRS_NOTE, ''); RegisterPropertyToSkip(TAreaSeries, 'Stairs', STAIRS_NOTE, '');
RegisterPropertyToSkip(TAreaSeries, 'InvertedStairs', STAIRS_NOTE, ''); RegisterPropertyToSkip(TAreaSeries, 'InvertedStairs', STAIRS_NOTE, '');
RegisterPropertyToSkip(TLineSeries, 'OnDrawPointer', DRAWPOINTER_NOTE, '');
end; end;
initialization initialization

View File

@ -226,10 +226,8 @@ type
FSelectionRect: TRect; FSelectionRect: TRect;
function CalculateNewExtent: TDoubleRect; function CalculateNewExtent: TDoubleRect;
function CalculateDrawRect: TRect; function CalculateDrawRect: TRect;
function GetProportional: Boolean;
procedure SetBrush(AValue: TZoomDragBrush); procedure SetBrush(AValue: TZoomDragBrush);
procedure SetFrame(AValue: TChartPen); procedure SetFrame(AValue: TChartPen);
procedure SetProportional(AValue: Boolean);
procedure SetSelectionRect(AValue: TRect); procedure SetSelectionRect(AValue: TRect);
strict protected strict protected
procedure Cancel; override; procedure Cancel; override;
@ -249,9 +247,6 @@ type
property DrawingMode; property DrawingMode;
property EscapeCancels; property EscapeCancels;
property Frame: TChartPen read FFrame write SetFrame; property Frame: TChartPen read FFrame write SetFrame;
property Proportional: Boolean
read GetProportional write SetProportional stored false default false;
deprecated;
property RatioLimit: TZoomRatioLimit property RatioLimit: TZoomRatioLimit
read FRatioLimit write FRatioLimit default zrlNone; read FRatioLimit write FRatioLimit default zrlNone;
property RestoreExtentOn: TRestoreExtentOnSet property RestoreExtentOn: TRestoreExtentOnSet
@ -606,6 +601,7 @@ var
implementation implementation
uses uses
LResources,
TAChartStrConsts, TACustomSeries, TAEnumerators, TAGeometry, TAMath; TAChartStrConsts, TACustomSeries, TAEnumerators, TAGeometry, TAMath;
function InitBuiltinTools(AChart: TChart): TBasicChartToolset; function InitBuiltinTools(AChart: TChart): TBasicChartToolset;
@ -1222,11 +1218,6 @@ begin
ADrawer.SetTransparency(0); ADrawer.SetTransparency(0);
end; end;
function TZoomDragTool.GetProportional: Boolean;
begin
Result := RatioLimit = zrlProportional;
end;
procedure TZoomDragTool.MouseDown(APoint: TPoint); procedure TZoomDragTool.MouseDown(APoint: TPoint);
begin begin
if not FChart.AllowZoom then exit; if not FChart.AllowZoom then exit;
@ -1295,14 +1286,6 @@ begin
FFrame.Assign(AValue); FFrame.Assign(AValue);
end; end;
procedure TZoomDragTool.SetProportional(AValue: Boolean);
begin
if AValue then
RatioLimit := zrlProportional
else
RatioLimit := zrlNone;
end;
procedure TZoomDragTool.SetSelectionRect(AValue: TRect); procedure TZoomDragTool.SetSelectionRect(AValue: TRect);
begin begin
if (FSelectionRect = AValue) or not IsActive or IsAnimating then exit; if (FSelectionRect = AValue) or not IsActive or IsAnimating then exit;
@ -2044,6 +2027,14 @@ begin
end; end;
end; end;
procedure SkipObsoleteProperties;
const
PROPORTIONAL_NOTE = 'Obsolete, use TZoomDragTool.RatioLimit=zlrProportional instead';
begin
RegisterPropertyToSkip(TZoomDragTool, 'Proportional', PROPORTIONAL_NOTE, '');
end;
initialization initialization
ToolsClassRegistry := TClassRegistry.Create; ToolsClassRegistry := TClassRegistry.Create;
@ -2061,6 +2052,8 @@ initialization
RegisterChartToolClass(TDataPointCrosshairTool, @rsDataPointCrosshair); RegisterChartToolClass(TDataPointCrosshairTool, @rsDataPointCrosshair);
RegisterChartToolClass(TUserDefinedTool, @rsUserDefinedTool); RegisterChartToolClass(TUserDefinedTool, @rsUserDefinedTool);
SkipObsoleteProperties;
finalization finalization
FreeAndNil(ToolsClassRegistry); FreeAndNil(ToolsClassRegistry);