mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 04:49:25 +02:00
TAChart: Add initial framework for transparency support
git-svn-id: trunk@38453 -
This commit is contained in:
parent
4af32ed4f2
commit
fa127299e6
@ -66,6 +66,7 @@ type
|
||||
procedure SetActive(AValue: Boolean); override;
|
||||
procedure SetDepth(AValue: TChartDistance); override;
|
||||
procedure SetTitle(AValue: String); virtual;
|
||||
procedure SetTransparency(AValue: TChartTransparency); override;
|
||||
procedure SetZPosition(AValue: TChartDistance); override;
|
||||
procedure StyleChanged(Sender: TObject);
|
||||
procedure UpdateParentChart;
|
||||
@ -111,6 +112,7 @@ type
|
||||
|
||||
published
|
||||
property Legend: TChartSeriesLegend read FLegend write SetLegend;
|
||||
property Transparency;
|
||||
property ShowInLegend: Boolean
|
||||
read GetShowInLegend write SetShowInLegend stored false default true;
|
||||
deprecated;
|
||||
@ -521,6 +523,13 @@ begin
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TCustomChartSeries.SetTransparency(AValue: TChartTransparency);
|
||||
begin
|
||||
if FTransparency = AValue then exit;
|
||||
FTransparency := AValue;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
|
||||
procedure TCustomChartSeries.SetZPosition(AValue: TChartDistance);
|
||||
begin
|
||||
if FZPosition = AValue then exit;
|
||||
|
@ -63,6 +63,8 @@ type
|
||||
TChartColorToFPColorFunc = function (AColor: TChartColor): TFPColor;
|
||||
TGetFontOrientationFunc = function (AFont: TFPCustomFont): Integer;
|
||||
|
||||
TChartTransparency = 0..255;
|
||||
|
||||
{ IChartDrawer }
|
||||
|
||||
IChartDrawer = interface
|
||||
@ -103,6 +105,7 @@ type
|
||||
procedure SetGetFontOrientationFunc(AValue: TGetFontOrientationFunc);
|
||||
procedure SetPen(APen: TFPCustomPen);
|
||||
procedure SetPenParams(AStyle: TFPPenStyle; AColor: TChartColor);
|
||||
procedure SetTransparency(ATransparency: TChartTransparency);
|
||||
procedure SetXor(AXor: Boolean);
|
||||
function TextExtent(const AText: String): TPoint;
|
||||
function TextExtent(AText: TStrings): TPoint;
|
||||
@ -124,6 +127,7 @@ type
|
||||
strict protected
|
||||
FChartColorToFPColorFunc: TChartColorToFPColorFunc;
|
||||
FGetFontOrientationFunc: TGetFontOrientationFunc;
|
||||
FTransparency: TChartTransparency;
|
||||
FXor: Boolean;
|
||||
function GetFontAngle: Double; virtual; abstract;
|
||||
function SimpleTextExtent(const AText: String): TPoint; virtual; abstract;
|
||||
@ -144,6 +148,7 @@ type
|
||||
procedure SetAntialiasingMode(AValue: TChartAntialiasingMode);
|
||||
procedure SetDoChartColorToFPColorFunc(AValue: TChartColorToFPColorFunc);
|
||||
procedure SetGetFontOrientationFunc(AValue: TGetFontOrientationFunc);
|
||||
procedure SetTransparency(ATransparency: TChartTransparency);
|
||||
procedure SetXor(AXor: Boolean);
|
||||
function TextExtent(const AText: String): TPoint;
|
||||
function TextExtent(AText: TStrings): TPoint;
|
||||
@ -344,6 +349,11 @@ begin
|
||||
FGetFontOrientationFunc := AValue;
|
||||
end;
|
||||
|
||||
procedure TBasicDrawer.SetTransparency(ATransparency: TChartTransparency);
|
||||
begin
|
||||
FTransparency := ATransparency;
|
||||
end;
|
||||
|
||||
procedure TBasicDrawer.SetXor(AXor: Boolean);
|
||||
begin
|
||||
FXor := AXor;
|
||||
|
@ -47,6 +47,7 @@ type
|
||||
FActive: Boolean;
|
||||
FChart: TChart;
|
||||
FDepth: TChartDistance;
|
||||
FTransparency: TChartTransparency;
|
||||
FZPosition: TChartDistance;
|
||||
|
||||
procedure AfterAdd; virtual; abstract;
|
||||
@ -60,6 +61,7 @@ type
|
||||
function GetShowInLegend: Boolean; virtual; abstract;
|
||||
procedure SetActive(AValue: Boolean); virtual; abstract;
|
||||
procedure SetDepth(AValue: TChartDistance); virtual; abstract;
|
||||
procedure SetTransparency(AValue: TChartTransparency); virtual; abstract;
|
||||
procedure SetZPosition(AValue: TChartDistance); virtual; abstract;
|
||||
procedure UpdateMargins(ADrawer: IChartDrawer; var AMargins: TRect); virtual;
|
||||
procedure VisitSources(
|
||||
@ -83,6 +85,8 @@ type
|
||||
property Active: Boolean read FActive write SetActive default true;
|
||||
property Depth: TChartDistance read FDepth write SetDepth default 0;
|
||||
property ParentChart: TChart read FChart;
|
||||
property Transparency: TChartTransparency
|
||||
read FTransparency write SetTransparency default 0;
|
||||
property ZPosition: TChartDistance read FZPosition write SetZPosition default 0;
|
||||
end;
|
||||
|
||||
@ -689,7 +693,9 @@ begin
|
||||
ADrawer.ClippingStart(FClipRect);
|
||||
try
|
||||
try
|
||||
ADrawer.SetTransparency(Transparency);
|
||||
Draw(ADrawer);
|
||||
ADrawer.SetTransparency(0);
|
||||
except
|
||||
Active := false;
|
||||
raise;
|
||||
|
Loading…
Reference in New Issue
Block a user