03-01-2010 02:13 AM
I am trying to track the move of a cross cursor on a plot, and tell if the cursor is passing some data points.
I found when I move cursor continously, the value of cursor index change discontinuously. That is it not follow 5, 6, 7, but may be 5, 6.5, 8.
The resolution of the screen may not exactly match the grid value of the plot.
To judge if the cursor passing a data point, I have to check if there is any data point within the data range of (CursorIndex + deltaX, CursorIndex - deltaX) . DeltaX may equal to 1.5.
But the most important is I cannot get the accurate deltaX and deltaY. I just test(try move slowly) and get it.
Is therer any accurate method to acquire deltaX and deltaY. Any suggestion, thanks.
03-01-2010 02:25 AM
How do you track the changing of the cursor?
I advise you to use an event called 'Cursor Move' Every time the user moves the cursor this event is triggered so it should work for you.
But be aware, the event can be triggered thousends of times per second so make sure the event finishes fast.
Ton
03-01-2010 02:43 AM
03-01-2010 02:50 AM
I'm not really sure what you want to accomplish, but if you want to detect passing a certain value with the cursor you can also check if
1) old cursor value is < CursorIndex and new cursor value is >= CursorIndex
or
2) old cursor value is > Cursor Index and new cursor value is <= CursorIndex.
Hope this helps