Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

TrackMode problem

I would like to have cursor that can be appeared wherever i click on the plot area, and also be dragged.
 
when i put this line 1, i only get cursor to be dragged,
 and if i put line 2 with code 1, i only get cursor to show up on spot where i clicked on the plot area.
Is there anyway i can have both features together?
Thank you~!!
 
 
line 1: m_graph_top.SetTrackMode(CNiGraph::TrackDragCursor);
 
line 2: m_graph_top.SetTrackMode(CNiGraph::TrackPlotAreaEvents);
 
code 1:
 

void CFinal1Dlg:lotAreaMouseDownCwgraphTop(short* Button, short* Shift, VARIANT* XPos, VARIANT* YPos)

{

m_graph_top.Cursors.Item("Cursor-1").SetPosition(CNiVariant(XPos),CNiVariant(YPos));

}

0 Kudos
Message 1 of 3
(3,024 Views)
The problem you might be experiencing might be due to CWGraph not tracking the necessary events in order to implement both the creation of cursors when you click and the dragging of the cursors with your mouse.  In order to track all events try using the Track All Events option.  The declaration of the function would look like this:
 
m_graph_top.SetTrackMode(CNiGraph::TrackAllEvents);
 
 
Regards,
 
Santiago D
National Instruments
0 Kudos
Message 2 of 3
(3,012 Views)

When at TrackAllEvents  mode cursors can respond to CurosrMouseup function, but cannot move the cursors. And TrackDragCursor mode can move the cursors, but cannot respond to CursorMouseUp function, how can I move cursors and let it respond to CursorMouseUp function at the same time?

0 Kudos
Message 3 of 3
(2,452 Views)