![]() |



Function |
Declared in: NiGraphEvents.h |
Declaration
void OnCursorMouseDown( short FAR* Button, short FAR* Shift, VARIANT FAR* XPos, VARIANT FAR* YPos, short FAR* CursorIndex, long FAR* CursorPart);
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.
Parameters
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.
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 containing the x position of the cursor.
Note: Use CNiVariant to get to the underlying data.
Variant containing the y position of the cursor.
Note: Use CNiVariant to get to the underlying data.
The one-based index of the cursor.
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
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. } }