OnCursorChange

CNi

Function Group
OnCursorChange() Functions    Prev page: OnClickNext page: OnCursorMouseDown    
Function Declared in:
NiGraphEvents.h

'Declaration' icon -- Shortcut to top of page. Declaration

void OnCursorChange(
    long FAR* CursorIndex,
    VARIANT FAR* XPos,
    VARIANT FAR* YPos,
    BOOL FAR* bTracking);

'Description' icon -- Shortcut to top of page. Description

Generated when you reposition a cursor with the mouse.

Note: This event is generated only if the graph's TrackMode property is set to CNiGraph::TrackDragCursor.

Shortcut to top of page. Parameters

long FAR* CursorIndex

Contains the one-based index of the cursor generating the event.

VARIANT FAR* XPos

Contains the x position of the cursor.

Note: Use CNiVariant to get to the underlying data.

VARIANT FAR* YPos

Contains the y position of the cursor.

Note: Use CNiVariant to get to the underlying data.

BOOL FAR* bTracking

Contains true if the user clicked the mouse when the event occurred.

'See Also' icon -- Shortcut to top of page. See Also

Shortcut to top of page. Example

void OnCursorChange(long FAR* CursorIndex, VARIANT FAR* XPos, VARIANT FAR* YPos, BOOL FAR* bTracking) {
    // Read and set the X and Y cursor positions.
    m_xPos = CNiVariant(*XPos);
    m_yPos = CNiVariant(*YPos);
}