TAChart: Fix mouse coordinates passed to KeyUp/KeyDown tool events

git-svn-id: trunk@31970 -
This commit is contained in:
ask 2011-08-13 09:20:36 +00:00
parent 9589bb8c23
commit ad3dfd2bae

View File

@ -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;