TAChart: Built-in zoom tool eating MouseMove event
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
Even if built-in zooming and panning support of TAChart is turned off (AllowZoom = false) the OnMouseMove event of TChart does not fire when the left mouse button is pressed.
Please see these discussions in the forum:
http://forum.lazarus.freepascal.org/index.php/topic,22957.0.html
http://forum.lazarus.freepascal.org/index.php/topic,22946.0.html
As the OP in these discussions notes, a workaround can be achieved by linking the chart to a ChartToolset. But, of course, this is not a permanent solution.
Steps to reproduce:
In the attached demo, the OnMouseMove event of the chart causes a message box to pop up if the left mouse button is pressed while dragging the mouse across the chart. This does not happen, i.e. the OnMouseMove event is not fired.
After application of the attached patch, the message does appear.
In the patched TATools unit, the MouseMove method of TZoomDragTool is left immediately if the the tool is not active. The built-in tool is not activated if the property AllowZoom of the chart is set to false. Therefore, the built-in zoom tool no longer catches the OnMouseMove event.
Mantis conversion info:
- Mantis ID: 25439
- Version: 1.3 (SVN)
- Fixed in version: 1.2.0
- Fixed in revision: 43738 (#8d5dfb7e)