OnPlotAreaMouseMove

CNi

Function Group
OnPlotAreaMouseMove() Functions    Prev page: OnPlotAreaMouseDownNext page: OnPlotAreaMouseUp    
Function Declared in:
NiGraphEvents.h

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

void OnPlotAreaMouseMove(
    short FAR* Button,
    short FAR* Shift,
    VARIANT FAR* XPos,
    VARIANT FAR* YPos);

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

Generated when you move the mouse over the plot area.

Notes:

1. These events generate only if CNiGraph.TrackMode is TrackAllEvents or TrackPlotAreaEvents.

2. If you have multiple y axes, the y axis for the template plot is used. The point returned is the point clicked on, not the nearest point on a plot.

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.

  • 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.

  • 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.

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

Shortcut to top of page. Example

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