mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 21:19:35 +01:00
TAChart: Improved cooperation of TAxisClickTool with other tools.
git-svn-id: trunk@60796 -
This commit is contained in:
parent
6a763b0115
commit
e2af06f634
@ -1335,10 +1335,7 @@ var
|
|||||||
ts: TBasicChartToolset;
|
ts: TBasicChartToolset;
|
||||||
begin
|
begin
|
||||||
ts := GetToolset;
|
ts := GetToolset;
|
||||||
if
|
if (ts <> nil) and ts.Dispatch(Self, evidMouseDown, Shift, Point(X, Y)) then
|
||||||
// PtInRect(FClipRect, Point(X, Y)) and
|
|
||||||
(ts <> nil) and ts.Dispatch(Self, evidMouseDown, Shift, Point(X, Y))
|
|
||||||
then
|
|
||||||
exit;
|
exit;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -60,6 +60,7 @@ type
|
|||||||
property DrawingMode: TChartToolDrawingMode
|
property DrawingMode: TChartToolDrawingMode
|
||||||
read FDrawingMode write SetDrawingMode default tdmDefault;
|
read FDrawingMode write SetDrawingMode default tdmDefault;
|
||||||
strict protected
|
strict protected
|
||||||
|
FIgnoreClipRect: Boolean;
|
||||||
procedure Activate; override;
|
procedure Activate; override;
|
||||||
procedure Cancel; virtual;
|
procedure Cancel; virtual;
|
||||||
procedure Deactivate; override;
|
procedure Deactivate; override;
|
||||||
@ -763,11 +764,12 @@ begin
|
|||||||
case AEventId of
|
case AEventId of
|
||||||
evidKeyDown : KeyDown (APoint);
|
evidKeyDown : KeyDown (APoint);
|
||||||
evidKeyUp : KeyUp (APoint);
|
evidKeyUp : KeyUp (APoint);
|
||||||
evidMouseDown : MouseDown (APoint);
|
|
||||||
evidMouseMove : MouseMove (APoint);
|
|
||||||
evidMouseUp : MouseUp (APoint);
|
|
||||||
evidMouseWheelDown: MouseWheelDown(APoint);
|
evidMouseWheelDown: MouseWheelDown(APoint);
|
||||||
evidMouseWheelUp : MouseWheelUp (APoint);
|
evidMouseWheelUp : MouseWheelUp (APoint);
|
||||||
|
evidMouseMove : MouseMove (APoint);
|
||||||
|
evidMouseUp : MouseUp (APoint);
|
||||||
|
evidMouseDown : if FIgnoreClipRect or PtInRect(FChart.ClipRect, APoint) then
|
||||||
|
MouseDown(APoint);
|
||||||
end;
|
end;
|
||||||
ev := FEventsAfter[AEventId];
|
ev := FEventsAfter[AEventId];
|
||||||
if Assigned(ev) then
|
if Assigned(ev) then
|
||||||
@ -2027,6 +2029,7 @@ constructor TAxisClickTool.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
SetPropDefaults(Self, ['GrabRadius']);
|
SetPropDefaults(Self, ['GrabRadius']);
|
||||||
|
FIgnoreClipRect := true; // Allow mousedown outside cliprect
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAxisClickTool.GetHitTestInfo(APoint: TPoint): Boolean;
|
function TAxisClickTool.GetHitTestInfo(APoint: TPoint): Boolean;
|
||||||
@ -2048,14 +2051,20 @@ end;
|
|||||||
|
|
||||||
procedure TAxisClickTool.MouseDown(APoint: TPoint);
|
procedure TAxisClickTool.MouseDown(APoint: TPoint);
|
||||||
begin
|
begin
|
||||||
if GetHitTestInfo(APoint) then
|
if GetHitTestInfo(APoint) then begin
|
||||||
Activate;
|
Activate;
|
||||||
|
Handled;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAxisClickTool.MouseUp(APoint: TPoint);
|
procedure TAxisClickTool.MouseUp(APoint: TPoint);
|
||||||
begin
|
begin
|
||||||
if FHitTest <> [] then
|
if FHitTest <> [] then begin
|
||||||
|
GetHitTestInfo(APoint);
|
||||||
if Assigned(FOnClick) then FOnClick(Self, FAxis, FHitTest);
|
if Assigned(FOnClick) then FOnClick(Self, FAxis, FHitTest);
|
||||||
|
end;
|
||||||
|
Deactivate;
|
||||||
|
Handled;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user