george seifert Posted April 21, 2007 Report Share Posted April 21, 2007 http://forums.lavag.org/index.php?act=attach&type=post&id=5558http://forums.lavag.org/index.php?act=attach&type=post&id=5557 I started with the Dynamically Register for Events example VI and modified it to test some things I want to try (see attached VI). What I want to do is dynamically register mouse down events for the cluster of controls that the mouse is currently in. Once I have that then I can get the control references for that cluster so I can color label text of the selected control. It seems that I have to Register for Events (I hate the syntax of that, why can't it just be Register Events?) for the whole panel like the original example. If I try to register only the controls of interest (Trim registers and Capacitor control registers in my case) it won't let me do it (see the second VI test control colors_errors). why can't I register the Mouse Down event when the Mouse Enter event occurs for a control? Also the error that pops up when I hover on the broken wire doesn't make sense. It says refunm conflict:cannot connect different refum types The type of source is Event Registration Refnum The type of sink is Event Registration Refnum Uh, how are the source and sink different? George Quote Link to comment
Mellroth Posted April 21, 2007 Report Share Posted April 21, 2007 QUOTE(george seifert @ Apr 20 2007, 03:50 PM) Uh, how are the source and sink different? Hi George, you have to have a valid event registration refnum before entering the Event structure. In your case the event registration refnum is not defined until you have passed the "mouse enter" event. To solve this, I added a registration of events (empty array of control refnums), before the loop. http://forums.lavag.org/index.php?act=attach&type=post&id=5559''>http://forums.lavag.org/index.php?act=attach&type=post&id=5559'>http://forums.lavag.org/index.php?act=attach&type=post&id=5559 Good luck! /J Quote Link to comment
Ton Plomp Posted April 21, 2007 Report Share Posted April 21, 2007 The event Refnum is strictly typed, meaning that the data in the event is very precise (just like a queue), including the control type and event type, and you have the old type in the shift register, which doesn't update good in such cases. It is better to have it initialized outisde the while loop: http://forums.lavag.org/index.php?act=attach&type=post&id=5560 Ton Quote Link to comment
george seifert Posted April 21, 2007 Author Report Share Posted April 21, 2007 Oh man, I guess that was too easy. Either that or you're really smart (sounds better than me being dumb)! I didn't know that you have to have a valid event registration refnum before entering the Event structure. That bit of info clears up a lot of things. Thanks. :thumbup: George Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.