Hi,
i have Troubles with control events. My program is using graph cursor as X/Y axis control. When i click "into the graph", the mouse cursor is snapped to the graph cursor. I can "navigate" with mouse movements and the cursor position is continuously updated.
I need also switch between coarse and fine movement and i do it by cliclking the left mouse button again. The right mouse button should release the cursor and jump out of the graph, but this does not work properly.
The switching fine/coarse by left click produces further EVENTS and it activates the graph control again => i am locked in. I have tried to count those left click and swallow their events by calling GetUserEvent(..), but it does not work.. return(1) brings nothing as well..
Any hints, how to do it properly?
thank you
The code has roughly following structure:
int CVICALLBACK graph (...)
{
..
..
if(event == EVENT_VAL_CHANGED)
{
case GRAPH_WINDOW:
navigating_function(GRAPH_WINDOW);
break;
..
..
}
return 0;
}
navigating_function(& graph_control)
{
do
{
GetCursorPosition (x, y);
if( GetAsyncKeyState(VK_LBUTTON))
{
change_to_fine_or_coarse();
++count_left_click;
}
x = x + step;
y = y + step;
.. updating graph_control;
right = GetAsyncKeyState(VK_RBUTTON);
}while( !right && EVENT_RIGHT_CLICK);
for(count_left_click; count_left_click > 0; count_left_click--) GetUserEvent (0, &dummy, &dummy);
}