OnCursorMouseDown

CNi

Function Group
OnCursorMouseDown() Functions    Prev page: OnCursorChangeNext page: OnCursorMouseMove    
Function Declared in:
NiGraphEvents.h

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

void OnCursorMouseDown(
    short FAR* Button,
    short FAR* Shift,
    VARIANT FAR* XPos,
    VARIANT FAR* YPos,
    short FAR* CursorIndex,
    long FAR* CursorPart);

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

Generated when you click the mouse on a cursor.

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

Shortcut to top of page. Parameters

short FAR* Button

Contains the state of the mouse buttons, which can be any combination of the CNiGraph::MouseButton enumeration values. The following list includes valid enumeration values.

  • CNiGraph::LeftButton - the user pressed the left mouse button.
  • CNiGraph::RightButton - the user pressed the right mouse button.
  • CNiGraph::MiddleButton - the user pressed the middle mouse button.
short FAR* Shift

Contains the state of the SHIFT, CTRL, and ALT keys, which can be any combination of the CNiGraph::ShiftKeys enumeration values. The following list includes valid enumeration values.

  • CNiGraph::ShiftKey - the user pressed the SHIFT key.
  • CNiGraph::CtrlKey - the user pressed the CTRL key.
  • CNiGraph::AltKey - the user pressed the ALT key.
VARIANT FAR* XPos

Variant containing the x position of the cursor.

Note: Use CNiVariant to get to the underlying data.

VARIANT FAR* YPos

Variant containing the y position of the cursor.

Note: Use CNiVariant to get to the underlying data.

short FAR* CursorIndex

The one-based index of the cursor.

long FAR* CursorPart

Part of the cursor on which the event occurred. Use the CursorParts enumeration with this value. The list below includes valid values.

  • CNiGraph::CursorCrosshair - sets cursor near the intersection point.
  • CNiGraph::CursorXLine - sets cursor near the x (vertical) line.
  • CNiGraph::CursorYLine - sets cursor near the y (horizontal) line.

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

Shortcut to top of page. Example

void OnCursorMouseDown(short FAR* Button, short FAR* Shift, VARIANT FAR* XPos, VARIANT FAR* YPos, short FAR* CursorIndex, long FAR* CursorPart) {
   if ((CNiVariant(XPos) > 20 && CNiVariant(YPos) < 100) && (*Shift == CNiGraph::ShiftKey | CNiGraph::AltKey)) {
       // Your event code here.
   }
}