LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Event Registry, Code Problem

Hey Everybody,
I was playing around with one of the help files about dynamically registering events and tried to make my own but there is something faulty with it. 
 
The VI is very simple, just like the help file there are a few controls on the front panel which when you click on them will follow the mouse wherever it goes.  It is supposed to drop the controls when you release the mouse but for some reason I cannot get that to happen.  I've attached the code: LV7.1
 
thanks,
jonathan
 
0 Kudos
Message 1 of 5
(3,541 Views)
You have a couple problems here, but kudos to you for investigating dynamic events!  Playing with LabVIEW like this is how I learned most of what I know.

1.  Register the Mouse Up event for the VI, not the Controls[].  I'm not sure why, but it seems that the control on which you Mouse Down does not catch the Mouse Up because the Position property in the Mouse Move event case puts the cursor outside the bounds of the body of the control.  Perhaps subtracting a few pixels from the cursor coords before applying them to the Position would work too, but I found that it can be fixed by registering for the Mouse Up event at the VI level.

2.  Make sure to wire in the VI reference on both the Mose Move and Mouse Up events inside the Mouse Down event case.

You'll have to re-assign the Mouse Up event case when you change it from the Controls[] source to the VI source.  Try it with no peaking, but I've attached my edited version as well.

Have fun,

Dan Press
Certified LabVIEW Architect
PrimeTest Automation




Message Edited by Photon Dan on 08-16-2006 10:31 AM

Message 2 of 5
(3,526 Views)

thanks... yeah, all i had to do was rewire the registration to the VI.  worked nicely.

 

 

0 Kudos
Message 3 of 5
(3,522 Views)

Oh, one more question...

What's the difference between: 'Mouse Down'  and 'Mouse Down?'

0 Kudos
Message 4 of 5
(3,517 Views)
Events ending with a question mark (?) are filter events.  The other guys are notify events.  You can mix a bunch of notify events in the same case such that any of them fire that event case, but you cannot do that with filter events.  The filter events give you to option of discarding the action that triggered the event.  For example, the Panel Close? event can be discarded so that the panel does not close if you do not want it to.  See the LabVIEW Help section on Event Structures >> caveats.

Dan Press
Certified LabVIEW Architect
PrimeTest Automation
Message 5 of 5
(3,508 Views)