07-15-2005 08:31 AM
07-18-2005 03:17 PM - edited 07-18-2005 03:17 PM
Hello Gajanan,
There isn't a function to restrict the cursor to a particular plot. You will have to do this programmatically. You can get the ID of the plot the cursor is currently over (if it is a snap-to-point cursor) with the GetGraphCursorIndex (panel, PANEL_GRAPH, eventData1, &plothandle, &index) function. The ID of the cursor that was moved will be passed in the eventData1 parameter. If the plotHandle is not the plot you want the cursor associated with, you can choose not to display the X/Y coordinates of the cursor on the UI and reset the cursor to a default location on a specified plot with the SetGraphCursorIndex function.
For instance, if you create two cursors and you want cursor 1 to be associated with plot 1 and cursor 2 to be associated with plot 2, you could do something like this:
/* Get the cursor's position */
GetGraphCursor (panel, PANEL_GRAPH, eventData1, &x, &y);
/* Figure out which plot and which point the Cursor is over */
GetGraphCursorIndex (panel, PANEL_GRAPH, eventData1, &plothandle, &index);
if (plothandle == eventData1) {
/* Display the data */
SetCtrlVal (panel, PANEL_XREADOUT, x);
SetCtrlVal (panel, PANEL_YREADOUT, y);
SetCtrlVal (panel, PANEL_INDEX, index);
printf("E1: %d, x: %f, y: %f, index: %d, plotHandle: %d\n",
eventData1, x, y, index, plothandle);
} else SetGraphCursorIndex(panel, PANEL_GRAPH, eventData1, eventData1, 0);
Thanks.
Message Edited by Wendy L on 07-18-2005 03:18 PM
07-19-2005 01:08 AM
Thanks Wendy.
07-19-2005 01:44 AM
07-19-2005 12:40 PM
09-05-2005 04:06 AM