LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic Graph Panning in CVI

Instead of relying on the inherent CVI panning functionality for graphs,  I would like to perform graph panning programmatically by using the ctrl button and a mouse down on the graph control to drag the direction of the pan.  Alternately some may prefer the use of compass buttons instead to perform graph panning.   Are there good code examples that show how panning is achieved?  Thanks.
0 Kudos
Message 1 of 3
(3,324 Views)
You could think to use the scrollbar custom control to pan the graph. The custom control is located in ...\toolslib\custctrl directory, while in ...\samples\userint\custctrl you can find a good example on how to use it.
 
I am attaching a modified version of this sample project that shows panning on the X axis of a graph via the use of a scroll bar control: take a llok at it to see if it can help you in your application.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,294 Views)
Thanks for the help.  With your example I can finally really see the usefulness of the scroll control.  Using this method for panning a waveform has an inherent ability to zoom the graph as well.

In view of the alternate method to perform panning such as using the mouse to "drag" the view left or right when a control key is depressed, it seems to me that this involves turning on a polling timer once the control key is detected as depressed and the the graph is in focus.  You then get a reference position with the mouse and determine relative differences in mouse position and adjust the axis scaling mode at each polling timer event till the graph is de-focused.  Does this approach make sense?
0 Kudos
Message 3 of 3
(3,255 Views)