LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do a Multi Level Menu Ring?

My applications menu ring is getting too long. Is there a Multi Level Menu Ring?

Thanks.
0 Kudos
Message 1 of 10
(5,871 Views)

I don't think that there is a way to do this currently, but we have had suggestions for this use case.  If you don't mind, can you post what you are putting in your ring control (not items, just the idea) so I can get a better grasp of what you are trying to use the ring for?

Thank you

Jeff Peters

LabVIEW R & D

Message Edited by jpeters on 04-12-2007 09:26 PM

Message Edited by jpeters on 04-12-2007 09:26 PM

0 Kudos
Message 2 of 10
(5,856 Views)
I'm a little confused. Are you referring to the VI's run-time menu? That already allows multi-levels, if I understand your term correctly.
0 Kudos
Message 3 of 10
(5,832 Views)
I thought he was talking about the menu that opens on a ring when you operate it. 
 
Jeff P
 
Message 4 of 10
(5,823 Views)
It's true there isn't any direct support for having nested ring menus inside ring controls, but some of the other responses have highlighted a decent workaround. In LabVIEW 8.0 and later you can create your own custom shortcut menus which can have a nested structure. The trick here would involve treating all left-button mouse clicks on your ring control like a right button mouse click, so that instead of the default ring menu, the user would actually see the shortcut menu.

You can alter events on a control using an Event Structure and Filter Events. So you can actually change the Mouse Down event on your ring control from being button 1 (left-button) to being button 2 (right-button). Then the shortcut menu will pop up, and you can display your nested menu structure. When they make a selection, you can programmatically change the ring control's value to match their new selection.

This won't be a complete workaround, since it will look a little different, but it might interest you. Here's an example in 8.2. If you need it saved back to 8.0, let me know.
Jarrod S.
National Instruments
0 Kudos
Message 5 of 10
(5,817 Views)
Thanks Jeff for your reply. I use Menu Rings in variety of different ways. In most of my applications the nesting would be useful. As an example, I have a VI that performs programming & control of an equipment or a device. There are multiple scripts written for each type of device that the user can select through the ring menu. Where possible, I have been using multiple rings or re-population of the same ring to manage this but it would be great to have this capability.
0 Kudos
Message 6 of 10
(5,810 Views)
Another issue that I forget to mention in my earlier posting was that depending where the ring is located on the screen, it chops off the lower portion of the list (ie. no scroll bar).
Also, thank you jarred for posting the sample code. It is an interesting method of implementing the nested ring. It might be a little confusing to the users. As you know right-click on the Mac is command-click.
I'm not sure that I fully understand how the two ring events manage to lockout the mouse left key and load the menus, but it does work. Can the short cut list be populated programmatically using the rings property?
0 Kudos
Message 7 of 10
(5,803 Views)
The method I suggested doesn't require the user to know to right click the menu control. Instead it cheats by treating all normal left clicks like right clicks for that specific control. I'm honestly not sure how it would work on a Mac. Hopefully Command-click would be treated the same as a right click, but if you needed to, I'm sure you could get the same functionality. In my example you'll see something called Platform Mods in the Mouse Down? Event Case. I'm pretty sure you could programmatically change a regular mouse click to a Command mouse click by setting the Cmd item in that cluster to true.

The shortcut list for a control can be populated dynamically at run-time, but not through a property node for the control. Instead, this requires an Event Case for the control called Shortcut Menu Activation. Here you get a reference to the Menu Item and you can use the Menu functions in LabVIEW to dynamically populate the shortcut menu that gets shown to the user.

Message Edited by Jarrod S. on 04-13-2007 03:33 PM

Jarrod S.
National Instruments
0 Kudos
Message 8 of 10
(5,793 Views)
Thanks Jarrod. Using your abc2.vi I am able to get the mac/left click to display the short cut menus and return the user selction. However, I'm having trouble configuring the Menu functions properly to dynamically populate the ring and short cut menus. If possible, could you demonstrate this on your abc2.vi?

Thanks again.

PS. are there any plans to include the nested ring in your upcoming release?
0 Kudos
Message 9 of 10
(5,780 Views)
As someone noted earlier, I would highly recommend you to go to ni.com and click on Contact NI to file a product suggestion for nested menu rings. We do take these suggestions seriously, and it really helps give us as developers some broader insight into how people use LabVIEW and what would benefit them most.

NI generally doesn't comment on future product releases or features, and I'm going to abide by that, so I hope you understand.

I found an excellent example in the Example Finder for LabVIEW. Search for the term menus and open the example called Run-Time Shortcut Menus. It details pretty much exactly what we're trying to accomplish here, and is much better organized and documented than I'd have time to do. Hope this helps!

On a side note, if you got an implementation of this to work to your satisfaction, you might consider packaging it in the form of an XControl so that others could use it almost as easily as a native control.
Jarrod S.
National Instruments
0 Kudos
Message 10 of 10
(5,760 Views)