mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-09 20:59:32 +01:00
TAChart: Use TChartLegendItems instead of TObjectList
git-svn-id: trunk@31344 -
This commit is contained in:
parent
c1fdd2bbe1
commit
67e4a0d07f
@ -5,7 +5,7 @@ unit main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Contnrs, Controls, ExtCtrls, Graphics, Spin, StdCtrls, Forms,
|
Controls, ExtCtrls, Graphics, Spin, StdCtrls, Forms,
|
||||||
TAGraph, TASeries, TASources, Classes, TALegend, TAFuncSeries;
|
TAGraph, TASeries, TASources, Classes, TALegend, TAFuncSeries;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -47,7 +47,7 @@ type
|
|||||||
procedure seSpacingChange(Sender: TObject);
|
procedure seSpacingChange(Sender: TObject);
|
||||||
procedure seSymbolWidthChange(Sender: TObject);
|
procedure seSymbolWidthChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
FItems: TObjectList;
|
FItems: TChartLegendItems;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|||||||
@ -279,7 +279,7 @@ type
|
|||||||
procedure DrawLegendOn(ACanvas: TCanvas; var ARect: TRect);
|
procedure DrawLegendOn(ACanvas: TCanvas; var ARect: TRect);
|
||||||
procedure EnableRedrawing;
|
procedure EnableRedrawing;
|
||||||
function GetFullExtent: TDoubleRect;
|
function GetFullExtent: TDoubleRect;
|
||||||
function GetLegendItems: TObjectList;
|
function GetLegendItems: TChartLegendItems;
|
||||||
procedure PaintOnAuxCanvas(ACanvas: TCanvas; ARect: TRect);
|
procedure PaintOnAuxCanvas(ACanvas: TCanvas; ARect: TRect);
|
||||||
procedure PaintOnCanvas(ACanvas: TCanvas; ARect: TRect);
|
procedure PaintOnCanvas(ACanvas: TCanvas; ARect: TRect);
|
||||||
procedure SaveToBitmapFile(const AFileName: String); inline;
|
procedure SaveToBitmapFile(const AFileName: String); inline;
|
||||||
@ -924,7 +924,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChart.GetLegendItems: TObjectList;
|
function TChart.GetLegendItems: TChartLegendItems;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -142,10 +142,12 @@ type
|
|||||||
public
|
public
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
procedure Draw(
|
procedure Draw(
|
||||||
ADrawer: IChartDrawer; AItems: TObjectList; const ABounds: TRect);
|
ADrawer: IChartDrawer; AItems: TChartLegendItems; const ABounds: TRect);
|
||||||
function MeasureItem(ADrawer: IChartDrawer; AItems: TObjectList): TPoint;
|
function MeasureItem(
|
||||||
|
ADrawer: IChartDrawer; AItems: TChartLegendItems): TPoint;
|
||||||
function Prepare(
|
function Prepare(
|
||||||
ADrawer: IChartDrawer; AItems: TObjectList; var AClipRect: TRect): TRect;
|
ADrawer: IChartDrawer; AItems: TChartLegendItems;
|
||||||
|
var AClipRect: TRect): TRect;
|
||||||
// Not includes the margins around item.
|
// Not includes the margins around item.
|
||||||
published
|
published
|
||||||
property Alignment: TLegendAlignment
|
property Alignment: TLegendAlignment
|
||||||
@ -355,7 +357,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChartLegend.Draw(
|
procedure TChartLegend.Draw(
|
||||||
ADrawer: IChartDrawer; AItems: TObjectList; const ABounds: TRect);
|
ADrawer: IChartDrawer; AItems: TChartLegendItems; const ABounds: TRect);
|
||||||
var
|
var
|
||||||
i, itemHeight: Integer;
|
i, itemHeight: Integer;
|
||||||
r: TRect;
|
r: TRect;
|
||||||
@ -394,7 +396,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TChartLegend.MeasureItem(
|
function TChartLegend.MeasureItem(
|
||||||
ADrawer: IChartDrawer; AItems: TObjectList): TPoint;
|
ADrawer: IChartDrawer; AItems: TChartLegendItems): TPoint;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
@ -410,7 +412,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TChartLegend.Prepare(
|
function TChartLegend.Prepare(
|
||||||
ADrawer: IChartDrawer; AItems: TObjectList; var AClipRect: TRect): TRect;
|
ADrawer: IChartDrawer; AItems: TChartLegendItems; var AClipRect: TRect): TRect;
|
||||||
var
|
var
|
||||||
x, y: Integer;
|
x, y: Integer;
|
||||||
sidebar, legendSize: TPoint;
|
sidebar, legendSize: TPoint;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user