PA-Paul Posted November 4, 2010 Report Share Posted November 4, 2010 Hi All, I have a bit of code (LV 8.6) which populates a menu ring based on the contents of a directory. I want the user to be able to select from the menu and in doing so trigger an event (within an event structure). So, I set up a "value change" event on the menu ring and basically it works. However, sometimes there may only be one item in the menu ring, in this case, clicking it doesn't change the value and hence doesn't trigger the event. I tried adding a "mouse up" event to the structure, but that is only fired if the user clicks on the increment/decrement button part of the menu ring, not if they click on the text itself. The only way around this that I've found is to add a "<Select>" item to the menu ring and make sure this is the default value. Then the user has to select something and thus change the value. Is there a better way to do this? Thanks Quote Link to comment
jgcode Posted November 4, 2010 Report Share Posted November 4, 2010 Hi All, I have a bit of code (LV 8.6) which populates a menu ring based on the contents of a directory. I want the user to be able to select from the menu and in doing so trigger an event (within an event structure). So, I set up a "value change" event on the menu ring and basically it works. However, sometimes there may only be one item in the menu ring, in this case, clicking it doesn't change the value and hence doesn't trigger the event. I tried adding a "mouse up" event to the structure, but that is only fired if the user clicks on the increment/decrement button part of the menu ring, not if they click on the text itself. The only way around this that I've found is to add a "<Select>" item to the menu ring and make sure this is the default value. Then the user has to select something and thus change the value. Is there a better way to do this? Thanks Hi Ic3Knight, A workaround I also like is to place a refresh button next to the control (menu ring or other) and use its value change event. As I also find this is handy when you need to reselect that value at some point. Cheers -JG Quote Link to comment
Tim_S Posted November 4, 2010 Report Share Posted November 4, 2010 The only way around this that I've found is to add a "<Select>" item to the menu ring and make sure this is the default value. Then the user has to select something and thus change the value. Is there a better way to do this? I'm not sure what you're listing, but I've allowed a NULL option in doing something similar sounding, so there was an empty string option, thus always creating at least one entry if the directory was empty, two entries if the directory had one item. Tim 1 Quote Link to comment
PA-Paul Posted November 4, 2010 Author Report Share Posted November 4, 2010 Thanks for the replies, I found the "mouse up" event not working quite an interesting one - how come it doesn't register the event if you mouse up on the menu itself? Only on the increment? I like the refresh idea, and Tim_S - my "<Select>" item does pretty much what your null does too... Thanks again! Paul Quote Link to comment
jdunham Posted November 4, 2010 Report Share Posted November 4, 2010 (edited) Don't you want the "mouse down?" event? Populate Ring.vi Edited November 4, 2010 by jdunham Quote Link to comment
jdunham Posted November 5, 2010 Report Share Posted November 5, 2010 Here's an LV 8.6 version Populate Ring.vi Quote Link to comment
PA-Paul Posted November 11, 2010 Author Report Share Posted November 11, 2010 Now that's odd.... The "mouse down" event will fire if I click anywhere on the menu ring. The "mouse up" event only fires if I click on the increment part of the menu ring - not the main text bit. I thought the "mouse up" was fired when you released the mouse button over the control (similar to the way a boolean control can be set to switch on release rather than click)? So why doesn't it work on the menu ring? Cheers Paul 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.