LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse wheel event coordinates issue in LV2013

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.

0 Kudos
Message 1 of 8
(3,959 Views)

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:

Zero Coords.png

 

Kind regards,

Heinz

0 Kudos
Message 2 of 8
(3,913 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 8
(3,909 Views)

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?

0 Kudos
Message 4 of 8
(3,902 Views)

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

0 Kudos
Message 5 of 8
(3,866 Views)

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 😉

0 Kudos
Message 6 of 8
(3,838 Views)

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.

0 Kudos
Message 7 of 8
(3,752 Views)

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.

0 Kudos
Message 8 of 8
(3,357 Views)