mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 21:39:11 +02:00
TAChart: Add TZoomDragTool.Brush property
git-svn-id: trunk@38898 -
This commit is contained in:
parent
53848b11b5
commit
eff9f1abee
@ -22,7 +22,7 @@ interface
|
|||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, Controls, CustomTimer, Forms, FPCanvas, Types,
|
Classes, Controls, CustomTimer, Forms, FPCanvas, Graphics, Types,
|
||||||
TAChartUtils, TADrawUtils, TAGraph, TATypes;
|
TAChartUtils, TADrawUtils, TAGraph, TATypes;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -212,12 +212,14 @@ type
|
|||||||
zreClick, zreDifferentDrag);
|
zreClick, zreDifferentDrag);
|
||||||
TRestoreExtentOnSet = set of TRestoreExtentOn;
|
TRestoreExtentOnSet = set of TRestoreExtentOn;
|
||||||
strict private
|
strict private
|
||||||
|
FBrush: TBrush;
|
||||||
FFrame: TChartPen;
|
FFrame: TChartPen;
|
||||||
FPrevDragDir: TRestoreExtentOn;
|
FPrevDragDir: TRestoreExtentOn;
|
||||||
FRatioLimit: TZoomRatioLimit;
|
FRatioLimit: TZoomRatioLimit;
|
||||||
FRestoreExtentOn: TRestoreExtentOnSet;
|
FRestoreExtentOn: TRestoreExtentOnSet;
|
||||||
FSelectionRect: TRect;
|
FSelectionRect: TRect;
|
||||||
function GetProportional: Boolean;
|
function GetProportional: Boolean;
|
||||||
|
procedure SetBrush(AValue: TBrush);
|
||||||
procedure SetFrame(AValue: TChartPen);
|
procedure SetFrame(AValue: TChartPen);
|
||||||
procedure SetProportional(AValue: Boolean);
|
procedure SetProportional(AValue: Boolean);
|
||||||
strict protected
|
strict protected
|
||||||
@ -231,6 +233,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Draw(AChart: TChart; ADrawer: IChartDrawer); override;
|
procedure Draw(AChart: TChart; ADrawer: IChartDrawer); override;
|
||||||
published
|
published
|
||||||
|
property Brush: TBrush read FBrush write SetBrush;
|
||||||
property DrawingMode;
|
property DrawingMode;
|
||||||
property EscapeCancels;
|
property EscapeCancels;
|
||||||
property Frame: TChartPen read FFrame write SetFrame;
|
property Frame: TChartPen read FFrame write SetFrame;
|
||||||
@ -1064,12 +1067,14 @@ constructor TZoomDragTool.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
SetPropDefaults(Self, ['RestoreExtentOn']);
|
SetPropDefaults(Self, ['RestoreExtentOn']);
|
||||||
|
FBrush := TBrush.Create;
|
||||||
FFrame := TChartPen.Create;
|
FFrame := TChartPen.Create;
|
||||||
FPrevDragDir := zreDifferentDrag;
|
FPrevDragDir := zreDifferentDrag;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TZoomDragTool.Destroy;
|
destructor TZoomDragTool.Destroy;
|
||||||
begin
|
begin
|
||||||
|
FreeAndNil(FBrush);
|
||||||
FreeAndNil(FFrame);
|
FreeAndNil(FFrame);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
@ -1079,6 +1084,7 @@ begin
|
|||||||
if not IsActive or IsAnimating then exit;
|
if not IsActive or IsAnimating then exit;
|
||||||
inherited;
|
inherited;
|
||||||
PrepareDrawingModePen(ADrawer, Frame);
|
PrepareDrawingModePen(ADrawer, Frame);
|
||||||
|
ADrawer.SetBrush(Brush);
|
||||||
ADrawer.Rectangle(FSelectionRect);
|
ADrawer.Rectangle(FSelectionRect);
|
||||||
ADrawer.SetXor(false);
|
ADrawer.SetXor(false);
|
||||||
end;
|
end;
|
||||||
@ -1104,6 +1110,7 @@ begin
|
|||||||
tdmXor: with FChart.Drawer do begin
|
tdmXor: with FChart.Drawer do begin
|
||||||
SetXor(true);
|
SetXor(true);
|
||||||
Pen := Frame;
|
Pen := Frame;
|
||||||
|
Brush := Self.Brush;
|
||||||
Rectangle(FSelectionRect);
|
Rectangle(FSelectionRect);
|
||||||
FSelectionRect.BottomRight := APoint;
|
FSelectionRect.BottomRight := APoint;
|
||||||
Rectangle(FSelectionRect);
|
Rectangle(FSelectionRect);
|
||||||
@ -1192,6 +1199,12 @@ begin
|
|||||||
Handled;
|
Handled;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TZoomDragTool.SetBrush(AValue: TBrush);
|
||||||
|
begin
|
||||||
|
if FBrush = AValue then exit;
|
||||||
|
FBrush.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TZoomDragTool.SetFrame(AValue: TChartPen);
|
procedure TZoomDragTool.SetFrame(AValue: TChartPen);
|
||||||
begin
|
begin
|
||||||
FFrame.Assign(AValue);
|
FFrame.Assign(AValue);
|
||||||
|
Loading…
Reference in New Issue
Block a user