Complete the following steps to customize a menu statically.
- Select Edit»Run-Time Menu to display the Menu Editor dialog box.
- Select Custom from the Menu Type pull-down menu.
- In the Item Type pull-down menu, select User Item. To add LabVIEW default menu items to a custom menu, select Application Item and select the LabVIEW menu items you want.
Note If you want to use LabVIEW default keyboard shortcuts in a custom menu, you must add their corresponding default menu items to the custom menu. However, the default keyboard shortcuts for cutting an object, copying an object, pasting an object, displaying the Context Help window, locking the Context Help window, and displaying the LabVIEW Help are included in the custom menu by default.|
- In the Item Name text box, type a menu item name. The menu item name appears in the Preview field and the Item Tag field. You can modify the tag name to give the menu item a unique identifier. The block diagram uses the tag name to identify the menu item programmatically. Menu item tags can have the same name as menu item names.
(Windows) In the Item Name text box, enter an underscore (_) in front of the letter you want the user to press with the <Alt> key to open the menu from the keyboard. If the item name begins with two underscores (__), LabVIEW removes the leading underscores when the item name appears on the menu but includes all other underscores you entered. Use this feature when menu items contain underscore characters but you do not want any characters to be underlined.
Note If you enter two underscores at the beginning of the item name, you prevent LabVIEW from assigning shortcut keys to the <Alt> key, but you can still assign a shortcut key to the item name in the Shortcut text box.|
- Place a checkmark in the Enabled checkbox to make the item available to the user. Removing the checkmark dims the menu item, making it unavailable to the user.
- Place a checkmark in the Checked checkbox to cause a checkmark to appear next to the menu item. A checkmark is useful for operations that continuously run until the user removes the checkmark from the menu item.
- Create a keyboard shortcut in the Shortcut text box. You can use the <F1> to <F24> function keys without using the <Ctrl> key as a modifier key. You must use the <Ctrl> menu key in addition to any other key. (Mac OS X) Use the <Command> key. (Linux) Use the <Alt> key.
Note LabVIEW does not respond to keyboard shortcuts for dimmed menu items. (Mac OS X) Keyboard shortcuts for the function keys work only if the function keys are not assigned as shortcut keys for Exposé.|
- Click the blue plus button on the toolbar to add more items to the custom menu. Click the red X button to delete items.
- Select File»Save As to save the menu file. In the dialog box that appears, name the menu and click the OK button. When you load the VI, the customized menu automatically loads.
- Use a Case Structure to execute each menu item.
You can arrange the menu hierarchy in the Menu Editor dialog box by clicking the arrow buttons on the toolbar, using the hierarchy manipulation options in the Edit menu, or by dragging and dropping. You can expand or collapse hierarchies by clicking the submenu glyphs or by choosing from the expand or collapse options in the Edit menu. To add separators, select Separator in the Item Type pull-down menu.