PlotAreaMouseDown, PlotAreaMouseMove, PlotAreaMouseUp Events

3D Graph Control

PlotAreaMouseDown, PlotAreaMouseMove, PlotAreaMouseUp Events

Syntax

Sub ControlName_PlotAreaMouseDown( Button As Integer, Shift As Integer, XNear As Variant, YNear As Variant, ZNear As Variant, XFar As Variant, YFar As Variant, ZFar As Variant)

Sub ControlName_PlotAreaMouseMove( Button As Integer, Shift As Integer, XNear As Variant, YNear As Variant, ZNear As Variant, XFar As Variant, YFar As Variant, ZFar As Variant)

Sub ControlName_PlotAreaMouseUp( Button As Integer, Shift As Integer, XNear As Variant, YNear As Variant, ZNear As Variant, XFar As Variant, YFar As Variant, ZFar As Variant)

Applies To

CWGraph3D

Purpose

Generates PlotAreaMouseDown when you click the mouse on the plot area.

Generates PlotAreaMouseMove when you move the mouse over the plot area.

Generates PlotAreaMouseUp when you release the mouse over the plot area.

Remarks

These events are generated only if CWGraph3D.TrackMode is set to cwGTrackAllEvents or cwGTrackPlotAreaEvents.

In Visual Basic, use the following constants with the Button and Shift parameters:

vbLeftButton1Left button is pressed
vbRightButton2Right button is pressed
vbMiddleButton4Middle button is pressed
vbShiftMask1 <Shift> key is pressed
vbCtrlMask2 <Ctrl> key is pressed
vbAltMask4 <Alt> key is pressed

When you display a three-dimensional object on a two-dimensional computer screen, you see a projection of the 3D space to the 2D space. For example, visualize a three-dimensional object, like a streetlight, casting a shadow on the ground. The shadow, which is being cast on a flat (or two-dimensional) surface, actually loses a dimension. Because of this loss of a dimension, multiple points in the 3D space are projected onto one point in the 2D space. That is, the points Pn = (XNear, YNear, ZNear) and Pf = (XFar, YFar, ZFar) are two 3D points that get mapped to the 2D mouse location. With these two coordinates, you can find the line on which every 3D point passing through Pn and Pf is mapped to the same 2D location. Mathematically, a 3D point X gets mapped to the 2D mouse location if there is a value A such that X = (1 - A) * Pn + A * Pf. Or conversely, every value of A produces an X that gets mapped to the mouse location.

Note: If you are trying to find the coordinates of your mouse pointer on a plot, use one of the PlotMouse events instead.

Parameters

Button As Integer

The button that is pressed, released, or, in the case of a mouse move, the buttons that are down. The Button argument is a bit field with bits corresponding to the left button (Bit 0), right button (Bit 1), and middle button (Bit 2).

Shift As Integer

The state of the <Shift> , <Ctrl> , and <Alt> keys when the button specified in the Button argument is pressed, released, or moved. The Shift argument is a bit field with the least-significant bits corresponding to the <Shift> key (Bit 0), the <Ctrl> key (Bit 1), and the <Alt> key (Bit 2 ). Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.

XNear As Variant

The X value of a point under the mouse pointer that was closer to the user when the event occurred.

YNear As Variant

The Y value of a point under the mouse pointer that was closer to the user when the event occurred.

ZNear As Variant

The Z value of a point under the mouse pointer that was closer to the user when the event occurred.

XFar As Variant

The X value of a point under the mouse pointer that was further from the user when the event occurred.

YFar As Variant

The Y value of a point under the mouse pointer that was further from the user when the event occurred.

ZFar As Variant

The Z value of a point under the mouse pointer that was further from the user when the event occurred.

See Also

TrackMode

PlotMouseDown

PlotMouseMove

PlotMouseUp

Mouse Events (3D Graph) Example