LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CWGraph set cursor to mouse pointer

I'm using Labwindows CVI 6.0 FULL on Win2K, here is the problem, I have a CWGraph and a cursor on my plot, but if a Zoom an area I loose the cursor, how can I bring the cursor to the closest point near my mouse pointer.

thank you,
0 Kudos
Message 1 of 3
(3,840 Views)
Before you execute your zoom use GetGraphCursor to get the x and y of your cursor. If this is within your zoom coordinates do nothing (or calculate the new cursor position based on the new graph dimensions.) If it is outside your zoom region you can use GetMouseRelativeState to find your mouse cursor with respect to the graph and use it to SetGraphCursor.

You may also want to study the shipping example graphcursors in the userint dir.

Hope this helps

Amaury Rolin,
NI Aplications Engineer.
0 Kudos
Message 2 of 3
(3,840 Views)

I have handled this in VB6 differently.

 

Private Sub CWGraph1_Zoom()

    Randomize

    Me.CWGraph1.Cursors(i).XPosition = Rnd() * (Me.CWGraph1.Axes(1).Maximum - Me.CWGraph1.Axes(1).Minimum) + Me.CWGraph1.Axes(1).Minimum

End Sub

 

It will keep the cursor within the range of the horizontal axis.

0 Kudos
Message 3 of 3
(3,341 Views)