02-03-2011 07:48 PM
I inherited some code that uses enum controls. I created an event structure to trigger when an enum value change occurs. The event triggers only when the scroll buttons are used, not when the value is changed using the pull-down list. Is there a property that controls this behavior?
I have written test code using an enum control and it behaves as expected, i.e., both the scroll buttons and pull-down menu generate a value change event.
02-03-2011 10:54 PM
Can you post your vi which inherited from someone else?
02-04-2011 10:18 AM
If you pop up the menu list and release it without changing to a different value, you have not changed the value and the event will not occur. You should get an event if the value actually changes. Is it possible that this is what you are seeing?
Lynn
12-14-2011 12:34 PM
And how do you detect an event when the user does not change the value of the enum control?
12-14-2011 12:38 PM
You could use the mouse up event. So if they click on the drop down it would register on the up click of the mouse.
12-14-2011 12:43 PM
That's what I thought too, but it doesn't generate an event. Actually I've read that the control's drop down list is reading the mouse up event, making it no longer usable by the programmer.
12-14-2011 12:49 PM - edited 12-14-2011 12:50 PM
Mouse down works but you may get two changes if the mouse down and they change the value. If that is ok then mouse down would work for you.
12-14-2011 04:05 PM
The enum is not really intended as a UI control, but the same can not be said for the ring and since this little annoyance also exists for the ring I can't simply say "Don't use an enum as a UI control". I would add a suggestion to the Idea Exchange that selecting the existing value from the popup menu fires either the 'Operate Menu Dismissed' or Value Changed event (I'd have to think about which I would prefer, probably value change since it is easy to compare the new and old values).
The Combo Box will fire a Value Changed Event even if you do not change the value, but this control is not a direct replacement for the ring. If you want to ensure that the user makes a choice, I suggest you force the user to make a choice. Two ways to do this: One is to add a blank or <Select Something> element to a ring which the user must change. The second is to add an ok button which when clicked tells you the user is done futzing with your menus.
12-15-2011 12:00 PM
I believe what Jabdo56 is saying is Enum mouse up event doesn't fire when the action is mouse up on the list box. It work just fine when the increment/decrement button is used. Enum maybe a derived UI control but this is a flaw of the event structure. It should be addressed.
I too noticed this in a project of mine, I work around it by using value change, then added mouse up with Ctrl key pressed to generate repeated value (ok beyond the point here). Point is this needs fixing.