mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 17:20:56 +02:00
TAChart: Fix mouse coordinates passed to KeyUp/KeyDown tool events
git-svn-id: trunk@31970 -
This commit is contained in:
parent
9589bb8c23
commit
ad3dfd2bae
@ -1024,20 +1024,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChart.KeyDownAfterInterface(var AKey: Word; AShift: TShiftState);
|
procedure TChart.KeyDownAfterInterface(var AKey: Word; AShift: TShiftState);
|
||||||
|
var
|
||||||
|
p: TPoint;
|
||||||
begin
|
begin
|
||||||
if GetToolset.Dispatch(Self, evidKeyDown, AShift, Mouse.CursorPos) then exit;
|
p := ScreenToClient(Mouse.CursorPos);
|
||||||
|
if GetToolset.Dispatch(Self, evidKeyDown, AShift, p) then exit;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChart.KeyUpAfterInterface(var AKey: Word; AShift: TShiftState);
|
procedure TChart.KeyUpAfterInterface(var AKey: Word; AShift: TShiftState);
|
||||||
|
var
|
||||||
|
p: TPoint;
|
||||||
begin
|
begin
|
||||||
|
p := ScreenToClient(Mouse.CursorPos);
|
||||||
// To find a tool, toolset must see the shift state with the key still down.
|
// To find a tool, toolset must see the shift state with the key still down.
|
||||||
case AKey of
|
case AKey of
|
||||||
VK_CONTROL: AShift += [ssCtrl];
|
VK_CONTROL: AShift += [ssCtrl];
|
||||||
VK_MENU: AShift += [ssAlt];
|
VK_MENU: AShift += [ssAlt];
|
||||||
VK_SHIFT: AShift += [ssShift];
|
VK_SHIFT: AShift += [ssShift];
|
||||||
end;
|
end;
|
||||||
if GetToolset.Dispatch(Self, evidKeyUp, AShift, Mouse.CursorPos) then exit;
|
if GetToolset.Dispatch(Self, evidKeyUp, AShift, p) then exit;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user