mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 12:49:42 +01:00 
			
		
		
		
	TAChart: Set TZoomDragTool.Brush.Style = bsClear by default
git-svn-id: trunk@38902 -
This commit is contained in:
		
							parent
							
								
									50c1480502
								
							
						
					
					
						commit
						b8f1a26235
					
				@ -22,7 +22,7 @@ interface
 | 
				
			|||||||
{$H+}
 | 
					{$H+}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
uses
 | 
					uses
 | 
				
			||||||
  Classes, Controls, CustomTimer, Forms, FPCanvas, Graphics, Types,
 | 
					  Classes, Controls, CustomTimer, Forms, FPCanvas, Types,
 | 
				
			||||||
  TAChartUtils, TADrawUtils, TAGraph, TATypes;
 | 
					  TAChartUtils, TADrawUtils, TAGraph, TATypes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type
 | 
					type
 | 
				
			||||||
@ -207,6 +207,8 @@ type
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  TZoomRatioLimit = (zrlNone, zrlProportional, zrlFixedX, zrlFixedY);
 | 
					  TZoomRatioLimit = (zrlNone, zrlProportional, zrlFixedX, zrlFixedY);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  TZoomDragBrush = TClearBrush;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TZoomDragTool = class(TBasicZoomTool)
 | 
					  TZoomDragTool = class(TBasicZoomTool)
 | 
				
			||||||
  published
 | 
					  published
 | 
				
			||||||
  type
 | 
					  type
 | 
				
			||||||
@ -215,14 +217,14 @@ type
 | 
				
			|||||||
      zreClick, zreDifferentDrag);
 | 
					      zreClick, zreDifferentDrag);
 | 
				
			||||||
    TRestoreExtentOnSet = set of TRestoreExtentOn;
 | 
					    TRestoreExtentOnSet = set of TRestoreExtentOn;
 | 
				
			||||||
  strict private
 | 
					  strict private
 | 
				
			||||||
    FBrush: TBrush;
 | 
					    FBrush: TZoomDragBrush;
 | 
				
			||||||
    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 SetBrush(AValue: TZoomDragBrush);
 | 
				
			||||||
    procedure SetFrame(AValue: TChartPen);
 | 
					    procedure SetFrame(AValue: TChartPen);
 | 
				
			||||||
    procedure SetProportional(AValue: Boolean);
 | 
					    procedure SetProportional(AValue: Boolean);
 | 
				
			||||||
  strict protected
 | 
					  strict protected
 | 
				
			||||||
@ -236,7 +238,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 Brush: TZoomDragBrush 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;
 | 
				
			||||||
@ -1071,7 +1073,8 @@ constructor TZoomDragTool.Create(AOwner: TComponent);
 | 
				
			|||||||
begin
 | 
					begin
 | 
				
			||||||
  inherited;
 | 
					  inherited;
 | 
				
			||||||
  SetPropDefaults(Self, ['RestoreExtentOn']);
 | 
					  SetPropDefaults(Self, ['RestoreExtentOn']);
 | 
				
			||||||
  FBrush := TBrush.Create;
 | 
					  FBrush := TZoomDragBrush.Create;
 | 
				
			||||||
 | 
					  FBrush.Style := bsClear;
 | 
				
			||||||
  FFrame := TChartPen.Create;
 | 
					  FFrame := TChartPen.Create;
 | 
				
			||||||
  FPrevDragDir := zreDifferentDrag;
 | 
					  FPrevDragDir := zreDifferentDrag;
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
@ -1209,7 +1212,7 @@ begin
 | 
				
			|||||||
  Handled;
 | 
					  Handled;
 | 
				
			||||||
end;
 | 
					end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
procedure TZoomDragTool.SetBrush(AValue: TBrush);
 | 
					procedure TZoomDragTool.SetBrush(AValue: TZoomDragBrush);
 | 
				
			||||||
begin
 | 
					begin
 | 
				
			||||||
  if FBrush = AValue then exit;
 | 
					  if FBrush = AValue then exit;
 | 
				
			||||||
  FBrush.Assign(AValue);
 | 
					  FBrush.Assign(AValue);
 | 
				
			||||||
 | 
				
			|||||||
@ -60,6 +60,11 @@ type
 | 
				
			|||||||
    property Visible: Boolean read FVisible write SetVisible default true;
 | 
					    property Visible: Boolean read FVisible write SetVisible default true;
 | 
				
			||||||
  end;
 | 
					  end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  TClearBrush = class(TBrush)
 | 
				
			||||||
 | 
					  published
 | 
				
			||||||
 | 
					    property Style default bsClear;
 | 
				
			||||||
 | 
					  end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TFPCanvasHelperClass = class of TFPCanvasHelper;
 | 
					  TFPCanvasHelperClass = class of TFPCanvasHelper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  { TChartElement }
 | 
					  { TChartElement }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user