09-13-2013 04:15 AM
I realized some unexpected behavior when using the mouse wheel event of an XYGraph:
The event contains the mouse coordinates which should be relative to the origin of the pane according to the LabVIEW help (see Mouse Wheel (Control Event)). In my case these coordinates are shifted. At the same time, the coordinates returned by the Mouse Move and Mouse Down events are correct. I think the Mouse Move, Mouse Down and Mouse Wheel Event coords should all be the same, i.e. relative to the owning pane's origin? The graph is in a window divided by splitters. I am using LabVIEW 2013 Professional Development System.
09-16-2013 07:43 AM
Hi maxicon,
I tried to reproduce your described behavior - It works as expected (see the attached VI).
Please try to reproduce the issue again with the attached VI.
1. Move the mouse and see coords changing.
2. Operate the mouse wheel and see the coords are the same.
P.S. Zero-coordinates are marked in the frontpanel:
Kind regards,
Heinz
09-16-2013 07:47 AM
Please post a VI showing this behavior. Also please make sure that the panes are not "scrollable" as this might affect coordinates when using the mouse wheel. Simply because the mouse wheel also scrolls the pane, hence coordinates are "moving".
Norbert
09-16-2013 08:45 AM
Thanks for your answer,
I realized this problem within an XYGraph. I added a graph to your VI and changed the event source from the pane to the graph. now the problem occurs as I described.
any idea?
09-18-2013 08:56 AM
Hi maxicon,
I'm sorry or the late answer. This is definately a bug in LabVIEW - I will report it.
Unfortuately it is not a static offset, but depends also on the size of the graph.
Sorry for the inconvinience you're experiencing.
Kind regards
Heinz
09-19-2013 07:15 AM
Thanks! In the meantime I simply store the coordinates from the Mouse Move event and use them in the Mouse Wheel event case. Fortunately this is an easy workaround 😉
01-08-2014 02:44 PM
I think this is an issue for mouse wheel events over other controls. I checked the coordinates between a Mouse Move event and a Mouse Wheel event over an array of doubles and the mouse wheel coordinates did not match the mouse move coordinates.
03-10-2014 05:12 PM
I've noticed this problem while trying to code some special XYgraph zooming with the mouse wheel. I only encounter the problem when the XYgraph is part of a VI loaded into a SubPanel. The problem goes away when I test the plugin VI standalone. It seems to me that LV is incorrectly accounting fo the location of the SubPanel. As others have mentioned, this problem seems to be isolated to the mouse wheel event, and not the mouse up/down or move events.
My solution for now is to use mouse down with modifications. Ctrl+Click = zoom in as if the user mouse wheeled forward and Shift+Ctrl+Click = zoom out as if the user mouse wheeled backward. Obviously, this isn't as elegant for the user, but it will have to do for now.