On Windows, the standard behaviour of selection, dragging etc using the mouse is to cancel the operation if ESC is pressed.
This does not happen if I start creating a selection rectangle in a TChart. Pressing ESC does not cancel the operation.
Selection can't be cancelled by ESC
Re: Selection can't be cancelled by ESC
Hello,
In general, if mouse interacttion with the chart is being used for other than just zoom/scroll, then Chart.CancelMouse can be set to deactivate a zoom-underway.
Ref. https://steema.com/docs/teechart/vclfmx ... Mouse.html
Regards,
Marc
In general, if mouse interacttion with the chart is being used for other than just zoom/scroll, then Chart.CancelMouse can be set to deactivate a zoom-underway.
Ref. https://steema.com/docs/teechart/vclfmx ... Mouse.html
Code: Select all
// Tell the chart to do zoom or scroll as default:
Chart1.CancelMouse:=False;
Marc
Steema Support
Re: Selection can't be cancelled by ESC
My point is simply that the component does not adhere to standard Windows input behaviour in its default configuration.
Are you saying I should detect key presses manually during a rectangle selection, and set CancelMouse if ESC is pressed on the keyboard?
Are you saying I should detect key presses manually during a rectangle selection, and set CancelMouse if ESC is pressed on the keyboard?
Re: Selection can't be cancelled by ESC
Hello,
You could use the
You could use the
OnKeyDown
event to cancel the Zoom and Panning actions. Ie:
Code: Select all
procedure TForm1.Chart1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key=TeeKey_Escape then
begin
Chart1.Zoom.Active:=False;
Chart1.Panning.Active:=False;
Chart1.Draw;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |