10-23-2008 11:52 AM
Dear all,
I am using around 16 cursors on my graph.
At some time i want to hide all the cursors.
Is there any way to set the position of all the cursors at a single go rather than setting position of each cursor individually ?
Thanks,
Ritesh
Solved! Go to Solution.
10-23-2008 01:16 PM
10-23-2008 01:43 PM
10-23-2008 01:52 PM
10-24-2008 03:45 AM
smercurio_fc wrote:
You can use the "Cursor Grab" event.
"Cursor Grab" event works fine, but i dont know how to use it in my application.
In my application, i either select the Plot or the Cursor. Cursor being given the higher priority.
I select the Plot with a "Mouse Down" event and using the Invoke Node "Get Plot at Position".
On a Mouse Down event i first want to see if any Cursor has been grabbed. If true, it should not execute "Get Plot at Position". and if false, it should see if there's any plot has been selected.
How to go about it ??
Thanks,
Ritesh
10-24-2008 05:43 AM
I have to do something similar in a program at the moment. I haven't written the code yet, but I was intending to:
1) create an array of references for the graphs (cursors can't be anywhere else)
2) pump the array through a for loop and create an array of cursor lists
3) pump the cursor list array through another for loop and set the cursor colours to transparent, rather than move them.
This sound like an idea you could use? (all fits in 1 subVI running from the array of references too, so tidy on the main BD).
10-24-2008 09:15 AM
Events happen in sequence, and the Mouse Down event occurs before the Cursor Grab event. Thus, there is no way to know in the Mouse Down event if you're going to have a Cursor Grab event, as I don't know of a way to view the event queue. There's two possibilities that come to mind:
10-24-2008 09:48 AM - edited 10-24-2008 09:49 AM
Will this work? It still hides them one at a time, but does it quickly and easily.
😎
10-24-2008 09:56 AM - edited 10-24-2008 09:58 AM
We seem to be talking about several different questions here. ![]()
The original question was how to hide all the cursors, and whether there was a way to do this en masse, or whether you had to use a loop. That question has already been answered several times: you have to use a loop.
The second question was how to determine whether a user clicking on the graph indicated that the user was selecting a cursor. That has also been answered by the fact that you use the Cursor Grab event.
The third question is how to distinguish between a user clicking on a plot, thereby indicating that they want to select a plot, and the user was just trying to grab a cursor.I provided a response to this in reply #7, but don't know if there's a more efficient method. I would love to hear if there is though.
10-24-2008 02:26 PM
Hi All,
Thanks alot for your Solutions.
I am using for loop to hide all the cursors and its just working perfectly.
And for choosing between the Cursor Grab or the Plot Selection, i used the first method as suggested by smercurio_fc, and that is also working our fine.
I didn't try the 2nd method(the one using queues).
Just want to know if the 2nd method will be faster or slower than the 1st to execute.
Thanks,
Ritesh