Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   GUI: locating mouse on graph indicator (http://www.chiefdelphi.com/forums/showthread.php?t=86141)

kamocat 18-06-2010 19:31

GUI: locating mouse on graph indicator
 
1 Attachment(s)
I'm working on another non-FRC project. The idea is that you can draw a waveform on a graph, and hear it played. However, instead of drawing a continuous curve, I figured it'd be easier to just select some points, and spline fit between them.
So, part of that involves converting the location of the mouse into the point on the graph, and that's where I'm having some trouble. It mostly works, but there's some scaling and offset issues.
I've attached the subVI and the testing VI.

NOTE:
If you do not understand control references, event structures, and property nodes, the code may be quite confusing.

EDIT: I forgot the attachement. Thanks Tanner.

Tanner 18-06-2010 20:40

Re: GUI: locating mouse on graph indicator
 
No attachment is present.

-Tanner

RyanCahoon 19-06-2010 14:00

Re: GUI: locating mouse on graph indicator
 
1 Attachment(s)
Looks like a) the coordinates for Plot Bounds are Panel-relative, rather than control-relative, so you're accounting for the control offset twice and b) since the mouse coordinate origin is at the top-left, the offset/scaling for the y-axis is reversed. The version I've attached seems to work.

--Ryan

kamocat 19-06-2010 19:24

Re: GUI: locating mouse on graph indicator
 
Thank you.


All times are GMT -5. The time now is 11:01.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi