NiceChart: Rename unit BSplines to NiceSplices to avoid conflict with one of the pl_XXX units

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9103 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-12-25 15:21:31 +00:00
parent 03417e642f
commit 711927ffd9
13 changed files with 770 additions and 22 deletions

View File

@ -41,7 +41,7 @@ uses
Windows, Messages,
{$ENDIF}
Classes, Graphics, Forms, Controls, ExtCtrls, SysUtils,
BSplines, Math;
NiceSplines, Math;
const
UndefinedValueChart: Double = MaxDouble;
@ -855,7 +855,7 @@ end;
procedure RotTextOut(ACanvas: TCanvas; x, y, Angle: Integer; Txt: String);
{$IFNDEF FPC}
var
RotFont, OldFont: Integer;
RotFont, OldFont: THandle;
FBold, FItalic, FUnderline, FStrikeOut: integer;
{$ENDIF}
begin
@ -916,7 +916,7 @@ begin
DoCalculate(Canvas, AWidth, AHeight)
else
begin
// Use an auxiliary bitmap in case of early calls when the Canvas has not handle, yet.
// Use an auxiliary bitmap in case of early calls when the Canvas has no handle, yet.
bmp := TBitmap.Create;
try
bmp.Width := AWidth;
@ -1020,6 +1020,8 @@ var
I, J: Integer;
P, T: Double;
begin
{$IFOPT R+}{$DEFINE RangeCheck}{$ENDIF}
{$R-}
repeat
I := L;
J := R;
@ -1042,6 +1044,7 @@ begin
then QuickSortDouble(SortList, L, J);
L := I;
until I >= R;
{$IFDEF RangeCheck}{$R+}{$ENDIF}
end;
function TNiceChart.GetLabel(Value: Double): string;
@ -1068,6 +1071,9 @@ begin
if (List.Count = 0) or ChartEmpty
then Exit;
{$IFOPT R+}{$DEFINE RangeCheck}{$ENDIF}
{$R-}
BarCount := 0;
for x := 0 to List.Count-1 do
begin
@ -1158,7 +1164,8 @@ begin
FXTranslate.Scale := Scale;
FXTranslate.Base := RcChart.Left;
end;
{$IFDEF RangeCheck}{$R+}{$ENDIF}
end;
procedure TNiceChart.BuildYAxis;

View File

@ -1,4 +1,4 @@
Unit BSplines;
Unit NiceSplines;
{------------------------------------------------------------------------------}
{ }
{ This code was written by : M. v. Engeland }
@ -226,6 +226,8 @@ end;{TBSpline.FGetNumberOfPoints}
function TBSpline.FGetPoint(Index:Integer):TVertex;
begin
{$IFOPT R+}{$DEFINE RangeCheck}{$ENDIF}
{$R-}
if (Index>=1) and (Index<=FNoPoints) then Result:=FPointList^[Index] else
begin
Result.X:=0;
@ -233,13 +235,17 @@ begin
Result.Y:=0;
Raise Exception.Create('List index out of bounds in '+Self.ClassName+'.FGetPoint. ('+IntToStr(Index)+').');
end;
{$IFDEF RangeChecke}{$R+}{$ENDIF}
end;{TBSpline.FGetPoint}
procedure TBSpline.FSetPoint(Index:Integer;Value:TVertex);
begin
if (Index>=1) and (Index<=FNoPoints) then
begin
{$IFOPT R+}{$DEFINE RangeCheck}{$ENDIF}
{$R-}
FPointList^[Index]:=Value;
{$IFDEF RangeChecke}{$R+}{$ENDIF}
Build:=False;
end else Raise Exception.Create('List index out of bounds in '+Self.ClassName+'.FSetPoint. ('+IntToStr(Index)+').');
end;{TBSpline.FSetPoint}