Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

CursorMouseUp - Event doesn't work

(VC++ 6.0sp5 + CW)
I have a 2D - Graph with an cursor. I'd like to get the CursorMouseUp-event but it' didn't come.

Could somebody help me please!

in the zip there is a small Dialog with the 2Graph which i use as my test-example.
0 Kudos
Message 1 of 6
(3,139 Views)
Try going to the Graph tab in the property pages and change the track mode option to "Plot & Cursor Events."

- Elton
0 Kudos
Message 2 of 6
(3,139 Views)
But then the Cursor doesn't move anymore!
0 Kudos
Message 3 of 6
(3,139 Views)
You must move the cursor programmatically. For example, you could move the cursor with the CursorMouseMove event procedure. If you want to interactively move the cursor without writing code, use the Cursor trackmode. Here is snippet of code (sorry, in VB) that shows how to move the cursor when the event is received:

Private Sub CWGraph1_CursorMouseDown(Button As Integer, Shift As Integer, XPos As Variant, YPos As Variant, CursorIndex As Integer, CursorPart As Long)
CsrEvent = "CursorMouseDown"
CursorMouseCommon Button, Shift, XPos, YPos, CursorIndex, CursorPart
'If the user clicked down with the left button on the cursor then begin dragging it
If (Button = vbLeftButton) Then
draggingCursor = True
dragCurso
rIndex = CursorIndex + 1
End If
End Sub


Private Sub CWGraph1_CursorMouseMove(Button As Integer, Shift As Integer, XPos As Variant, YPos As Variant, CursorIndex As Integer, CursorPart As Long)
CsrEvent = "CursorMouseMove"
CursorMouseCommon Button, Shift, XPos, YPos, CursorIndex, CursorPart
'Programmatically move the cursor if you click and drag on the cursor.
MoveCursor XPos, YPos
End Sub


Private Sub MoveCursor(XPos As Variant, YPos As Variant)
'Programmatically move the cursor if you click and drag on the cursor.
If (draggingCursor) Then
CWGraph1.Cursors(dragCursorIndex).SetPosition XPos, YPos
End If
End Sub
0 Kudos
Message 4 of 6
(3,139 Views)
I'm sorry, but your question only specified that you were looking for a way to get the CursorMouseUp event, and changing the track mode is the way you do that. It is not clear why you would want both the CursorMouseUp event and still want the cursor to move interactively rather than taking manual control of the cursor. If you want the event because you want to know when the cursor is moved, it would be better to leave the track mode alone and use the CursorChange event. Could you please provide more information about what you are trying to do? Thanks.

- Elton
0 Kudos
Message 5 of 6
(3,139 Views)
the cursor (2) are the borders for further calculation.
(to get the LinearFit of a part of the graph)

the user had to select where the best range for calculation is.
0 Kudos
Message 6 of 6
(3,139 Views)