Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

drag xy cursor and InteractionModeDefault to zoomxy

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?

0 Kudos
Message 1 of 18
(6,081 Views)

Hello sstrenn,

 

What versions of Measurement Studio and Visual Studio are you using?

0 Kudos
Message 2 of 18
(6,062 Views)
Measurement Studio 8.5.  Visual Studio 2008.  .net 3.5.
0 Kudos
Message 3 of 18
(6,050 Views)

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.

0 Kudos
Message 4 of 18
(6,028 Views)

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

0 Kudos
Message 5 of 18
(5,980 Views)

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.

0 Kudos
Message 6 of 18
(5,976 Views)

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.

 

  1. Load the project
  2. Note that for waveformGraph1, the InteractionMode is ZoomX, ZoomY, and DragCursor.
  3. Run the app.  Note that you can drag the cursor.  You can also zoom, but this requires holding down the shift key.  My customer does not want to have to do this.
  4. Close the app.
  5. For waveformGraph1, set InteractionMode to just DragCursor.  Set InteractionModeDefault to ZoomXY.
  6. Run the app.  Note that while you can zoom w/o having to hold down the shift key, you can no longer drag the XYCursor (even though it is selected as an interactionmode).  Also, at least for me, I wasn't able to "unzoom".

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

0 Kudos
Message 7 of 18
(5,954 Views)

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.

0 Kudos
Message 8 of 18
(5,934 Views)

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

0 Kudos
Message 9 of 18
(5,041 Views)

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  

0 Kudos
Message 10 of 18
(5,036 Views)