mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 11:49:55 +02:00
TAChart: Remove old deprecated code.
git-svn-id: trunk@59230 -
This commit is contained in:
parent
fc85354010
commit
a1b87dac3d
@ -108,6 +108,8 @@ procedure splineparameters
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
Math;
|
||||
|
||||
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
|
||||
end;
|
||||
k:=0;
|
||||
tol:=ae+re*spemax(abs(a), abs(b));
|
||||
tol:=ae+re*max(abs(a), abs(b));
|
||||
w1:=abs(b-a); stop:=false;
|
||||
while (abs(b-a)>tol) and (fb<>0) and (not stop) do
|
||||
begin
|
||||
@ -246,8 +248,8 @@ var i, sr, n1s, ns1, ns2: ArbInt;
|
||||
x:=(b*fc-c*fb)/(fc-fb);
|
||||
if abs(b-x)<tol
|
||||
then
|
||||
x:=b-tol*spesgn(b-a);
|
||||
if spesgn(x-m)=spesgn(x-b)
|
||||
x:=b-tol*sign(b-a);
|
||||
if sign(x-m)=sign(x-b)
|
||||
then
|
||||
x:=m
|
||||
end;
|
||||
@ -255,7 +257,7 @@ var i, sr, n1s, ns1, ns2: ArbInt;
|
||||
if term=2
|
||||
then
|
||||
exit;
|
||||
if spesgn(fa)*spesgn(fb)>0
|
||||
if sign(fa)*sign(fb)>0
|
||||
then
|
||||
begin
|
||||
a:=c; fa:=fc; k:=0
|
||||
@ -267,7 +269,7 @@ var i, sr, n1s, ns1, ns2: ArbInt;
|
||||
begin
|
||||
c:=b; fc:=fb; x:=a; b:=a; fb:=fa; a:=c; fa:=fc; k:=0
|
||||
end;
|
||||
tol:=ae+re*spemax(abs(a), abs(b));
|
||||
tol:=ae+re*max(abs(a), abs(b));
|
||||
w2:=abs(b-a);
|
||||
if w2>=w1
|
||||
then
|
||||
|
@ -53,8 +53,6 @@ type
|
||||
published
|
||||
property Caption: String read FCaption write SetCaption;
|
||||
property Distance default DEF_TITLE_DISTANCE;
|
||||
// Use LabelFont instead.
|
||||
property Font: TFont read GetFont write SetFont stored false; deprecated;
|
||||
property Frame;
|
||||
property LabelBrush;
|
||||
property PositionOnMarks: Boolean
|
||||
@ -276,7 +274,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
Math, SysUtils,
|
||||
Math, SysUtils, LResources,
|
||||
TAGeometry, TAMath;
|
||||
|
||||
{ TChartMinorAxisMarks }
|
||||
@ -789,4 +787,14 @@ begin
|
||||
AIndex += 1;
|
||||
end;
|
||||
|
||||
procedure SkipObsoleteProperties;
|
||||
const
|
||||
FONT_NOTE = 'Obsolete, use ChartTitle.LabelFont instead';
|
||||
begin
|
||||
RegisterPropertyToSkip(TChartAxisTitle, 'Font', FONT_NOTE, '');
|
||||
end;
|
||||
|
||||
initialization
|
||||
SkipObsoleteProperties;
|
||||
|
||||
end.
|
||||
|
@ -348,7 +348,8 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
Math, PropEdits, StrUtils, TAGeometry, TAMath, Types;
|
||||
Math, PropEdits, StrUtils, LResources, Types,
|
||||
TAGeometry, TAMath;
|
||||
|
||||
function CreateLazIntfImage(
|
||||
out ARawImage: TRawImage; const ASize: TPoint): TLazIntfImage;
|
||||
@ -1794,10 +1795,10 @@ begin
|
||||
end;
|
||||
|
||||
procedure SkipObsoleteProperties;
|
||||
const
|
||||
LEGEND_NOTE = 'Obsolete, use TCustomChartSeries.ShowInLegend instead';
|
||||
begin
|
||||
RegisterPropertyEditor(
|
||||
TypeInfo(Boolean), TCustomChartSeries,
|
||||
'ShowInLegend', THiddenPropertyEditor);
|
||||
RegisterPropertyToSkip(TCustomChartSeries, 'ShowInLegend', LEGEND_NOTE, '');
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
@ -348,9 +348,6 @@ type
|
||||
procedure GetLowerPredictionInterval(const Ax: Double; out AY: Double);
|
||||
procedure GetUpperPredictionInterval(const Ax: Double; out AY: Double);
|
||||
{$IFEND}
|
||||
function GetFitEquationString(
|
||||
ANumFormat: String; AXText: String = 'x'; AYText: String = 'y'): String;
|
||||
deprecated 'Use EquationText';
|
||||
function GetNearestPoint(
|
||||
const AParams: TNearestPointParams;
|
||||
out AResults: TNearestPointResults): Boolean; override;
|
||||
@ -482,14 +479,12 @@ type
|
||||
read FOnCalculate write SetOnCalculate;
|
||||
end;
|
||||
|
||||
|
||||
// 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.
|
||||
// Parameters are formatted by passing ANumFormat to the "Format" function.
|
||||
function ParamsToEquation(
|
||||
AEquation: TFitEquation; const AParams: array of Double;
|
||||
ANumFormat: String; AXText: String = 'x'; AYText: String = 'y'): String;
|
||||
deprecated 'Use IFitEquationText';
|
||||
|
||||
implementation
|
||||
|
||||
@ -1785,11 +1780,13 @@ begin
|
||||
end;
|
||||
{$IFEND}
|
||||
|
||||
{ Function removed, but left here commented to show useage of IEquationText.
|
||||
function TFitSeries.GetFitEquationString(ANumFormat: String; AXText: String;
|
||||
AYText: String): String;
|
||||
begin
|
||||
Result := EquationText.NumFormat(ANumFormat).X(AXText).Y(AYText);
|
||||
end;
|
||||
}
|
||||
|
||||
procedure TFitSeries.GetLegendItems(AItems: TChartLegendItems);
|
||||
var
|
||||
|
@ -333,7 +333,6 @@ type
|
||||
public // Helpers for series drawing
|
||||
procedure DrawLineHoriz(ADrawer: IChartDrawer; AY: Integer);
|
||||
procedure DrawLineVert(ADrawer: IChartDrawer; AX: Integer);
|
||||
procedure DrawOnCanvas(Rect: TRect; ACanvas: TCanvas); deprecated;
|
||||
function IsPointInViewPort(const AP: TDoublePoint): Boolean;
|
||||
|
||||
public
|
||||
@ -1030,11 +1029,6 @@ begin
|
||||
ADrawer.Line(AX, FClipRect.Top, AX, FClipRect.Bottom);
|
||||
end;
|
||||
|
||||
procedure TChart.DrawOnCanvas(Rect: TRect; ACanvas: TCanvas);
|
||||
begin
|
||||
PaintOnCanvas(ACanvas, Rect);
|
||||
end;
|
||||
|
||||
procedure TChart.DrawReticule(ADrawer: IChartDrawer);
|
||||
begin
|
||||
ADrawer.SetXor(true);
|
||||
|
@ -235,8 +235,6 @@ type
|
||||
property Inverted: Boolean read FInverted write SetInverted default false;
|
||||
property ItemFillOrder: TLegendItemFillOrder
|
||||
read FItemFillOrder write SetItemFillOrder default lfoColRow;
|
||||
property Margin: TChartDistance
|
||||
read FMarginX write SetMargin stored false; deprecated;
|
||||
property MarginX: TChartDistance
|
||||
read FMarginX write SetMarginX default DEF_LEGEND_MARGIN;
|
||||
property MarginY: TChartDistance
|
||||
@ -307,7 +305,8 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
Math, PropEdits, Types, TADrawerCanvas, TAGeometry;
|
||||
Math, PropEdits, Types, LResources,
|
||||
TADrawerCanvas, TAGeometry;
|
||||
|
||||
const
|
||||
SYMBOL_TEXT_SPACING = 4;
|
||||
@ -1032,9 +1031,10 @@ begin
|
||||
end;
|
||||
|
||||
procedure SkipObsoleteProperties;
|
||||
const
|
||||
MARGIN_NOTE = 'Obsolete, use Legend.MarginX instead';
|
||||
begin
|
||||
RegisterPropertyEditor(
|
||||
TypeInfo(TChartDistance), TChartLegend, 'Margin', THiddenPropertyEditor);
|
||||
RegisterPropertyToSkip(TChartLegend, 'Margin', MARGIN_NOTE, '');
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
@ -246,16 +246,10 @@ type
|
||||
property XErrorBars;
|
||||
property YErrorBars;
|
||||
// Events
|
||||
property OnDrawPointer: TSeriesPointerDrawEvent
|
||||
read FOnDrawPointer write FOnDrawPointer; deprecated 'Use OnCustomDrawPointer';
|
||||
property OnCustomDrawPointer;
|
||||
property OnGetPointerStyle;
|
||||
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.
|
||||
// Optimized to work efficiently for millions of points.
|
||||
// See http://en.wikipedia.org/wiki/Manhattan_plot
|
||||
@ -334,10 +328,6 @@ type
|
||||
property ZPosition;
|
||||
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;
|
||||
TSeriesGetBoundsEvent = procedure (var ABounds: TDoubleRect) of object;
|
||||
|
||||
@ -1824,13 +1814,13 @@ end;
|
||||
procedure SkipObsoleteProperties;
|
||||
const
|
||||
STAIRS_NOTE = 'Obsolete, use ConnectType instead';
|
||||
DRAWPOINTER_NOTE = 'Obsolete, use OnCustomDrawPointer instead';
|
||||
begin
|
||||
RegisterPropertyEditor(
|
||||
TypeInfo(Boolean), TLineSeries, 'ShowLines', THiddenPropertyEditor);
|
||||
RegisterPropertyEditor(
|
||||
TypeInfo(TChartAxisIndex), TConstantLine, 'AxisIndexX', THiddenPropertyEditor);
|
||||
RegisterPropertyToSkip(TAreaSeries, 'Stairs', STAIRS_NOTE, '');
|
||||
RegisterPropertyToSkip(TAreaSeries, 'InvertedStairs', STAIRS_NOTE, '');
|
||||
RegisterPropertyToSkip(TLineSeries, 'OnDrawPointer', DRAWPOINTER_NOTE, '');
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
@ -226,10 +226,8 @@ type
|
||||
FSelectionRect: TRect;
|
||||
function CalculateNewExtent: TDoubleRect;
|
||||
function CalculateDrawRect: TRect;
|
||||
function GetProportional: Boolean;
|
||||
procedure SetBrush(AValue: TZoomDragBrush);
|
||||
procedure SetFrame(AValue: TChartPen);
|
||||
procedure SetProportional(AValue: Boolean);
|
||||
procedure SetSelectionRect(AValue: TRect);
|
||||
strict protected
|
||||
procedure Cancel; override;
|
||||
@ -249,9 +247,6 @@ type
|
||||
property DrawingMode;
|
||||
property EscapeCancels;
|
||||
property Frame: TChartPen read FFrame write SetFrame;
|
||||
property Proportional: Boolean
|
||||
read GetProportional write SetProportional stored false default false;
|
||||
deprecated;
|
||||
property RatioLimit: TZoomRatioLimit
|
||||
read FRatioLimit write FRatioLimit default zrlNone;
|
||||
property RestoreExtentOn: TRestoreExtentOnSet
|
||||
@ -606,6 +601,7 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
LResources,
|
||||
TAChartStrConsts, TACustomSeries, TAEnumerators, TAGeometry, TAMath;
|
||||
|
||||
function InitBuiltinTools(AChart: TChart): TBasicChartToolset;
|
||||
@ -1222,11 +1218,6 @@ begin
|
||||
ADrawer.SetTransparency(0);
|
||||
end;
|
||||
|
||||
function TZoomDragTool.GetProportional: Boolean;
|
||||
begin
|
||||
Result := RatioLimit = zrlProportional;
|
||||
end;
|
||||
|
||||
procedure TZoomDragTool.MouseDown(APoint: TPoint);
|
||||
begin
|
||||
if not FChart.AllowZoom then exit;
|
||||
@ -1295,14 +1286,6 @@ begin
|
||||
FFrame.Assign(AValue);
|
||||
end;
|
||||
|
||||
procedure TZoomDragTool.SetProportional(AValue: Boolean);
|
||||
begin
|
||||
if AValue then
|
||||
RatioLimit := zrlProportional
|
||||
else
|
||||
RatioLimit := zrlNone;
|
||||
end;
|
||||
|
||||
procedure TZoomDragTool.SetSelectionRect(AValue: TRect);
|
||||
begin
|
||||
if (FSelectionRect = AValue) or not IsActive or IsAnimating then exit;
|
||||
@ -2044,6 +2027,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure SkipObsoleteProperties;
|
||||
const
|
||||
PROPORTIONAL_NOTE = 'Obsolete, use TZoomDragTool.RatioLimit=zlrProportional instead';
|
||||
begin
|
||||
RegisterPropertyToSkip(TZoomDragTool, 'Proportional', PROPORTIONAL_NOTE, '');
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
|
||||
ToolsClassRegistry := TClassRegistry.Create;
|
||||
@ -2061,6 +2052,8 @@ initialization
|
||||
RegisterChartToolClass(TDataPointCrosshairTool, @rsDataPointCrosshair);
|
||||
RegisterChartToolClass(TUserDefinedTool, @rsUserDefinedTool);
|
||||
|
||||
SkipObsoleteProperties;
|
||||
|
||||
finalization
|
||||
|
||||
FreeAndNil(ToolsClassRegistry);
|
||||
|
Loading…
Reference in New Issue
Block a user