03-18-2012 10:41 AM
Hello,
I'd like to use an indicator showing if one or two of the graph axes are scaled with respect to their original scale. Du to the present lack of an axis scale event (you may support my request here) I have tried different workarounds, without success.
If someone can provide useful insights or suggestions, please don't hesitate
Of course I could query the axis range after each plot, but since I have several tens of possible plots this solution doesn't look very elegant.
Thanks!
03-19-2012 07:35 AM - edited 03-19-2012 07:36 AM
I'm not sure when it came in, but in CVI 2010 there is an EVENT_ZOOM. Have you tried keying off of that? I believe it fires after the user is finished with the zoom action. In one of my projects I use it to get the new X and Y scales after the user has zoomed.
Edit: Now I see that you're trying to detect when the user has started zooming. I don't think my suggestion will work.
03-19-2012 07:53 AM
Thanks anyway! Yes, I am already using the EVENT_ZOOM. As it fires after the zoom it can't be used for this partuclar purpose, I guess.
03-24-2012 05:51 AM
Just in case someone wanted to contribute but was missing some details, here is the schematics of the graph callback:
int CVICALLBACK Graph ( int panel, int control, int event, void *callbackData, int eventData1, int eventData2 )
{
// check if CTRL key is depressed ( required fro zoom action )
UtilityGetKeyModifierStates ( &ctrl_modifier );
// if this is the first zoom action, obtain 'original' axis range
// does not work reliable because callback might be called after zoom
if ( ctrl_modifier && ( zoom_step == 0 ) )
{
UtilityGetAxisRange ( panel, PANEL_GRAPH, VAL_LEFT_YAXIS, &y_minimum, &y_maximum );
}
switch ( event )
{
case EVENT_LOST_FOCUS:
// turn off cursor display
break;
case EVENT_MOUSE_POINTER_MOVE:
// obtain and display cursor coordinates
break;
case EVENT_MOUSE_WHEEL_SCROLL:
// zoom action
break;
case EVENT_RIGHT_CLICK:
// prepare and display popup menu
break;
case EVENT_ZOOM:
switch ( eventData1 )
{
//
}
break;
}
}
return ( 0 );