01-06-2009 09:00 PM
I have a WaveformGraph (histogram) that needs to support zoom, pan, and cursors. My customer would like the zoom feature to not required the Shift key, so I set the InteractionModeDefault to ZoomXY. Unfortunately, this seems to have disabled my ability to drag my XYCursors.
Any suggestions of how to get what I want here?
01-08-2009 08:00 AM
Hello sstrenn,
What versions of Measurement Studio and Visual Studio are you using?
01-09-2009 04:02 PM
01-12-2009 09:50 AM
sstrenn,
There is a known issue with programmatically changing the Interaction Mode and its resulting effect on the behavior of a cursor prior to Measurement Studio 8.6 (Corrective Action Request #99334). This issue relates to the inaccessibility of Measurement Studio specific cursors prior to the aforementioned version. One workaround that I have seen in versions of Measurement Studio prior to 8.6 is to programmatically destory and recreate the component in question (Waveform Graph in your instance) each time the interaction mode is changed. This can be done by calling Dispose() on the component and then using the code that is automatically created by the IDE at design time to recreate that very same object. The data represented on the graph can even be maintained and applied back to the new component as a last step in this process.
01-17-2009 12:11 PM
Are you saying that if I upgrade to Measurement Studio 8.6, I'll be able to set the WaveformGraph's InteractionMode to ZoomXY and the user will be able to drag to zoom and also will be able to drag the XYCursors?
Stephen
01-17-2009 01:39 PM
Stephen,
Upgrading to version 8.6 will give you programmatic access to Measurement Studio's set of cursors that are used when performing the tasks you have mentioned.
01-18-2009 06:10 PM
Matt,
Not sure if we are quite on the same page here. I'm not having a problem with programmatic access to the XYCursors when the InteractionModeDefault is ZoomXY. The problem I'm having is that the USER is unable to move the
cursors when the InteractionModeDefault is ZoomXY.
I am attaching a small vs2008 project to demonstrate the problem.
So, my original question is how can I get InteractionModeDefault to be ZoomXY so that the user can just drag the cursor to zoom (rather than having to shift-click), and still allow the user to move the cursor around?
Stephen
01-19-2009 09:21 AM
Stephen,
Thanks for that helpful example illustrating your situation! I was previously under the impression that you were setting InteractionModeDefault programmatically rather than simply using the IDE's Properties window to do so. In any event, you cannot have two different interaction modes at the exact same time. You are going to have to do some programming to elect which default interaction mode you want. One idea I have for this would be to use the position of the mouse to determine if it matches the position of the cursor. If it does match this position (or is in some close range), you can set InteractionModeDefault to None, in order to accept the existing drag behavior indicated by InteractionMode. When the mouse leaves the proximity of the cursor, you can then reset InteractionModeDefault to ZoomXY. Note that all of these changes are made to InteractionModeDefault while InteractionMode remains DragCursor for the duration.
09-28-2009 09:44 AM
i don't understand this answer sorry
we want to remove the use of the shift key and we don't why in this item, you compare the position of the cursor and the mouse ?
all our customer don't like the way of zooming; they ask us to use the Ctrl + MouseWheel instead of Shift + rectangle of the zone to zoom.
we can catch the event Ctrl button + mouse wheel( up and down) but we don't know what we have to use to zoom up and zoom down
thks by advance
09-28-2009 11:48 AM
Hello -
You should take a look at the XYGraph.ZoomXY method. This will allow you to zoom in and out in your event handler.
NickB
National Instruments