01-28-2011 11:05 AM
I would like to have a menu item that performs the same function as a control event ("Save" or "Print"). Because there is only an event case for general "menu selection," it appears that I cannot just add an event for a specific case.
For example
Save Data case:
Button: Save Data
Menu Item: Save Data (Ctrl+S)
Print case:
Button: Print
Menu Item: Print (Ctrl+P)
Is there a way to do this without just duplicating the entire event case?
Solved! Go to Solution.
01-28-2011 11:10 AM
Create a user event that corresponds to the control. When the menu item is activated simply fire off the user event and pass and necessary data in the event itself.
01-28-2011 11:27 AM
Thank you!
I am unfamiliar with user events, so I will have to do some research on them.
01-28-2011 11:48 AM
Use Producer Consumer with Events template to start
In the consumer decode the event into a case structure by reading the menu item or menu tag string.
Heres a simple example
01-28-2011 04:20 PM
Thank you both. I have spent some time looking at the two methods, and I think I can make the second work. I'm still having a hard time understanding registered events, and how and what they cause to happen. It seems like an important concept, so I'll keep working at them. I've spent quite some time with the .vi provided in "help" for "Programmatically Fire Events." Is the "event structure" the same as the "event handler?" So it goes through the standard event case structure? If you have any ideas for clarifying this concept, I'd greatly appreciate it.
01-28-2011 09:30 PM
Yes, user events are processed in the event structure with the other standard LabVIEW events (value change, mouse up, menu eents, etc.). User events are very useful and are worth the time to learn.
01-28-2011 11:09 PM
01-31-2011 07:20 AM
Thank you very much for your help. I think I have a handle on these now.
01-31-2011 10:03 PM