Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

TrackPopupMenu causes CNiGraph::TrackZoomRectXY to fail

    I've posted this question before, but never received a solution.  I've finally narrowed down the problem to one particular function call, CMenu::TrackPopupMenu.  My problem is the following: I am working with an MDI application, create a CFormView class as my view, and insert a CWGraph object into the dialog window created by the CFormView class.  I then capture the DISPID_MOUSEDOWN event and if the Button parameter equals 0x02 (right-click), I display a popup menu.  The CFormView receives the popup menu options.

My understanding is that by setting the CWGraph object's track mode equal to CNiGraph::TrackZoomRectXY, it should allow me to draw the zoom box after left clicking and dragging my mouse.  On the contrary, I am required to double-click the graph before I get the zoom box.  The zoom box is attainable with a single click after that.  Double-clicking, but not releasing on the second click also grants the user access to the zoom box.  In addition, left mouse clicks are locked out and menus at the top of the application do not respond with a few random clicks outside the graph that seem to knock it out of it's zoom mode.

This problem does not occur when setting the track mode to CNiGraph::TrackPanPlotAreaXY.

I've posted source code and a compiled binary in the attachment.

The following is an extremely quick explanation of the code and the binary.

The code demonstrates that right-clicking on the graph and selecting zoom from the popup menu will not allow the user to single click and obtain the zoom box.  Oddly, right-clicking on the graph and selecting pan puts the graph in the pan mode immediately and requires only a single click to begin panning.  In addition, if you select the "Z" button on the toolbar at the top before ever right-clicking on the graph to get the popup menu, the graph goes immediately into zoom mode and requires only a single click.  I believe this works because the TrackPopupMenu function is never called.  Right-clicking the graph at any point (even if you don't select a menu option) and then trying the "Z" button on the toolbar requires the user to double-click the graph to get it into zoom mode.

All the applicable code is located in the file ExampleView.cpp.
/*    Called when the user right-clicks on the CWGraph object and shows a popup menu.   */
void CExampleView:: MouseDownCwgraph1(short Button, short Shift, long x, long y);

/*   Called when the user selects the zoom option from the right-click menu.  This option requires the user to double-click the graph to get into zoom mode.   */
void CExampleView:: OnTestmenuZoom();

/*   Called when the user selects the "Z" button on the toolbar.  This option immediately puts the CWGraph into zoom mode if the user never right-clicks on the graph.  Once the user right-clicks on the graph, however, it requires a double-click to put the graph into zoom mode.   */
void CExampleView:: OnZoom();

/*   Called when the user selects the pan option from the right-click menu.  This option automatically puts the graph into pan mode and a single click pans the graph.   */
void CExampleView:: OnTestmenuPan();

This project was compiled with Visual Studio 7.1.3.088 and Measuremen Studio 7.0.0.341.

I would greatly appreciate to know what's going on and a possible solution.
Thanks in advance.

p.s. Your post web page is NOT compatible with Windows Firefox 1.5.0.1:)
0 Kudos
Message 1 of 3
(3,932 Views)
This appears to be a bug with the tracking in the CWGraph control.  I have submitted your example program to the R&D department.  They should evaluate this issue for the next release of Measurement Studio. Unfortunately, there does not seem to be a decent work around other than not providing the option to select the Zoom function from the context menu.  I tried to specifically set the focus to the CWGraph control because I thought it may have been an issue with the focus, however this did not seem to resolve the issue.

I appreciate you bringing this issue forward and explaining it clearly with an example.

Regards,

Tyler T
Message 2 of 3
(3,912 Views)
Wonderful.  If you do figure out a workaround until then, would you, please, let me know at this post.  I've marked the RSS feed to keep up to date on any future changes.

Also, do you have an ETA on the next Measurement Studio release by any chance?
0 Kudos
Message 3 of 3
(3,903 Views)