LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receive mouse position relating to a graph without klicking

I want to show the user his actual mouse position, when he moves the mouse pointer over a graph. The user should get displayed the actual position relating to the graph without clicking. Is that possible?
0 Kudos
Message 1 of 4
(2,819 Views)
Hi,
I don't have LabVIEW 7. May be this can be easily done there.
But under LV 6 you can do it in following way.
1. Create Picture control with sizes equal to the graph's ones.
2. Fill it with transparent color.
3. Move it to front.
4. Place it over your graph. This must be done in order to arrange their positions horizontally and vertically.
5. Create "Property node" of your picture control.
6. Select "Mouse" property. This will return the cluster with many elements. One of them is mouse position inside picture. As we made sizes and position of picture equal to graph's then this will give you what you want.

The example is attached.

Good luck.

Oleg Chutko.
Message 2 of 4
(2,819 Views)
> I want to show the user his actual mouse position, when he moves the
> mouse pointer over a graph. The user should get displayed the actual
> position relating to the graph without clicking. Is that possible?

This isn't a built-in feature. If you catch mouse events or poll the
mouse on a timer and call a VI to return graph scale values that
correspond to the pixel. If you want to do anything else like snapping
to your data points, then that will involve comparing to your data
arrays or placeing a locked cursor at that pixel and seeing where it lands.

I looked in vi.lib for a few minutes and couldn't find the VI that does
the mapping. I suspect it is on devzone.

Greg McKaskle
0 Kudos
Message 3 of 4
(2,819 Views)
Measure Man-

I would suggest using the method proposed by Oleg. Using the picture control would be your best bet. The picture control allows you to find the position of the mouse using property nodes. If you place a picture control (the same size as the graph) behind the Graph then you will know the position of the cursor in relation to the graph.

-Erik
0 Kudos
Message 4 of 4
(2,819 Views)