mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 00:00:39 +02:00
TAChart: Add DoGetFontOrientation event to IChartDrawer interface
git-svn-id: trunk@30000 -
This commit is contained in:
parent
e9ca674759
commit
dfe7639567
@ -60,6 +60,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
TChartColorToFPColorFunc = function (AColor: TChartColor): TFPColor;
|
TChartColorToFPColorFunc = function (AColor: TChartColor): TFPColor;
|
||||||
|
TGetFontOrientationFunc = function (AFont: TFPCustomFont): Integer;
|
||||||
|
|
||||||
{ IChartDrawer }
|
{ IChartDrawer }
|
||||||
|
|
||||||
@ -97,6 +98,7 @@ type
|
|||||||
procedure SetBrush(ABrush: TFPCustomBrush);
|
procedure SetBrush(ABrush: TFPCustomBrush);
|
||||||
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
|
procedure SetBrushParams(AStyle: TFPBrushStyle; AColor: TChartColor);
|
||||||
procedure SetFont(AValue: TFPCustomFont);
|
procedure SetFont(AValue: TFPCustomFont);
|
||||||
|
procedure SetGetFontOrientationFunc(AValue: TGetFontOrientationFunc);
|
||||||
procedure SetPen(APen: TFPCustomPen);
|
procedure SetPen(APen: TFPCustomPen);
|
||||||
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
|
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
|
||||||
function TextExtent(const AText: String): TPoint;
|
function TextExtent(const AText: String): TPoint;
|
||||||
@ -109,6 +111,8 @@ type
|
|||||||
property Pen: TFPCustomPen write SetPen;
|
property Pen: TFPCustomPen write SetPen;
|
||||||
property DoChartColorToFPColor: TChartColorToFPColorFunc
|
property DoChartColorToFPColor: TChartColorToFPColorFunc
|
||||||
write SetDoChartColorToFPColorFunc;
|
write SetDoChartColorToFPColorFunc;
|
||||||
|
property DoGetFontOrientation: TGetFontOrientationFunc
|
||||||
|
write SetGetFontOrientationFunc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TBasicDrawer }
|
{ TBasicDrawer }
|
||||||
@ -116,6 +120,7 @@ type
|
|||||||
TBasicDrawer = class(TInterfacedObject, ISimpleTextOut)
|
TBasicDrawer = class(TInterfacedObject, ISimpleTextOut)
|
||||||
strict protected
|
strict protected
|
||||||
FChartColorToFPColorFunc: TChartColorToFPColorFunc;
|
FChartColorToFPColorFunc: TChartColorToFPColorFunc;
|
||||||
|
FGetFontOrientationFunc: TGetFontOrientationFunc;
|
||||||
function GetFontAngle: Double; virtual; abstract;
|
function GetFontAngle: Double; virtual; abstract;
|
||||||
function SimpleTextExtent(const AText: String): TPoint; virtual; abstract;
|
function SimpleTextExtent(const AText: String): TPoint; virtual; abstract;
|
||||||
procedure SimpleTextOut(AX, AY: Integer; const AText: String); virtual; abstract;
|
procedure SimpleTextOut(AX, AY: Integer; const AText: String); virtual; abstract;
|
||||||
@ -132,6 +137,7 @@ type
|
|||||||
AStartIndex: Integer = 0; ANumPts: Integer = -1); virtual; abstract;
|
AStartIndex: Integer = 0; ANumPts: Integer = -1); virtual; abstract;
|
||||||
function Scale(ADistance: Integer): Integer; virtual;
|
function Scale(ADistance: Integer): Integer; virtual;
|
||||||
procedure SetDoChartColorToFPColorFunc(AValue: TChartColorToFPColorFunc);
|
procedure SetDoChartColorToFPColorFunc(AValue: TChartColorToFPColorFunc);
|
||||||
|
procedure SetGetFontOrientationFunc(AValue: TGetFontOrientationFunc);
|
||||||
function TextExtent(const AText: String): TPoint;
|
function TextExtent(const AText: String): TPoint;
|
||||||
function TextExtent(AText: TStrings): TPoint;
|
function TextExtent(AText: TStrings): TPoint;
|
||||||
function TextOut: TChartTextOut;
|
function TextOut: TChartTextOut;
|
||||||
@ -161,6 +167,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function DummyGetFontOrientationFunc(AFont: TFPCustomFont): Integer;
|
||||||
|
begin
|
||||||
|
Unused(AFont);
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
function FPColorToChartColor(AFPColor: TFPColor): TChartColor;
|
function FPColorToChartColor(AFPColor: TFPColor): TChartColor;
|
||||||
begin
|
begin
|
||||||
Result :=
|
Result :=
|
||||||
@ -261,6 +273,7 @@ end;
|
|||||||
constructor TBasicDrawer.Create;
|
constructor TBasicDrawer.Create;
|
||||||
begin
|
begin
|
||||||
FChartColorToFPColorFunc := @ChartColorToFPColor;
|
FChartColorToFPColorFunc := @ChartColorToFPColor;
|
||||||
|
FGetFontOrientationFunc := @DummyGetFontOrientationFunc;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBasicDrawer.DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer);
|
procedure TBasicDrawer.DrawLineDepth(AX1, AY1, AX2, AY2, ADepth: Integer);
|
||||||
@ -297,6 +310,12 @@ begin
|
|||||||
FChartColorToFPColorFunc := AValue;
|
FChartColorToFPColorFunc := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBasicDrawer.SetGetFontOrientationFunc(
|
||||||
|
AValue: TGetFontOrientationFunc);
|
||||||
|
begin
|
||||||
|
FGetFontOrientationFunc := AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
function TBasicDrawer.TextExtent(const AText: String): TPoint;
|
function TBasicDrawer.TextExtent(const AText: String): TPoint;
|
||||||
var
|
var
|
||||||
sl: TStrings;
|
sl: TStrings;
|
||||||
|
Loading…
Reference in New Issue
Block a user