mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 14:29:33 +02:00
TAChart: Add TDataPointDragTool.OnDragStart event
git-svn-id: trunk@38786 -
This commit is contained in:
parent
d02fb67a89
commit
54f6a99a13
@ -403,6 +403,7 @@ type
|
|||||||
TDataPointDragTool = class(TDataPointTool)
|
TDataPointDragTool = class(TDataPointTool)
|
||||||
strict private
|
strict private
|
||||||
FOnDrag: TDataPointDragEvent;
|
FOnDrag: TDataPointDragEvent;
|
||||||
|
FOnDragStart: TDataPointDragEvent;
|
||||||
FOrigin: TDoublePoint;
|
FOrigin: TDoublePoint;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -413,6 +414,8 @@ type
|
|||||||
published
|
published
|
||||||
property ActiveCursor default crSizeAll;
|
property ActiveCursor default crSizeAll;
|
||||||
property OnDrag: TDataPointDragEvent read FOnDrag write FOnDrag;
|
property OnDrag: TDataPointDragEvent read FOnDrag write FOnDrag;
|
||||||
|
property OnDragStart: TDataPointDragEvent
|
||||||
|
read FOnDragStart write FOnDragStart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TDataPointClickTool }
|
{ TDataPointClickTool }
|
||||||
@ -1504,10 +1507,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDataPointDragTool.MouseDown(APoint: TPoint);
|
procedure TDataPointDragTool.MouseDown(APoint: TPoint);
|
||||||
|
var
|
||||||
|
p: TDoublePoint;
|
||||||
begin
|
begin
|
||||||
FindNearestPoint(APoint);
|
FindNearestPoint(APoint);
|
||||||
if FSeries = nil then exit;
|
if FSeries = nil then exit;
|
||||||
FOrigin := NearestGraphPoint;
|
FOrigin := NearestGraphPoint;
|
||||||
|
if Assigned(OnDragStart) then begin
|
||||||
|
p := FChart.ImageToGraph(APoint);
|
||||||
|
OnDragStart(Self, p);
|
||||||
|
if Toolset.FIsHandled then exit;
|
||||||
|
end;
|
||||||
Activate;
|
Activate;
|
||||||
Handled;
|
Handled;
|
||||||
end;
|
end;
|
||||||
@ -1516,7 +1526,7 @@ procedure TDataPointDragTool.MouseMove(APoint: TPoint);
|
|||||||
var
|
var
|
||||||
p: TDoublePoint;
|
p: TDoublePoint;
|
||||||
begin
|
begin
|
||||||
if FSeries = nil then exit;
|
if not IsActive or (FSeries = nil) then exit;
|
||||||
p := FChart.ImageToGraph(APoint);
|
p := FChart.ImageToGraph(APoint);
|
||||||
if Assigned(OnDrag) then begin
|
if Assigned(OnDrag) then begin
|
||||||
OnDrag(Self, p);
|
OnDrag(Self, p);
|
||||||
|
Loading…
Reference in New Issue
Block a user