07-25-2005 11:16 AM
07-26-2005 03:29 PM
Hello Pete,
If you are asking about obtaining mouse coordinates relative to the entire panel,
you can use the function GetGlobalMouseState to acquire the mouse
coordinates. I created a quick example program which will do this -- it
is the one attached here. If you are interested in the mouse coordinates
from the 3D control you can load the Function Panel for the 3D graph and register
events from the graph to create the appropriate callback function. One
even to use is the PlotAreaMouseMove which will generate an even when the mouse
moves in the Plot Area, this even will return the coordinates of the
mouse's position. Its prototype (which can also be seen in the help
screen with a little more information) is:
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)
Where the parameters are defined as:
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.
Thanks for posting, and please let us know if you have any further questions or
this did not answer your question.
Regards,
Travis M
NI
07-26-2005 06:12 PM
07-27-2005 02:11 PM
Hello again Pete,
There is a pretty good example about registering ActiveX events in CVI.
In the Help menu select "find examples" and search for
"ActiveX", there are a couple there that use ActiveX event registration,
but the example I was referring to is called "Events". In case
you cannot find it in the example finder, I'll attach it to this post.
Please take a look at this example and let me know if you have any questions on the
process.
Regards,
Travis M
NI