Create Pull-Down and Shortcut Menus
AutoCAD
Pull-down menus are displayed as a list under a menu bar or as part of the menu browser. Shortcut menus [also called context menus] are displayed at or near the crosshairs or cursor when you right-click in the drawing window, text window, command window, in toolbar areas, or the ribbon.
A pull-down menu can contain up to 999 commands. A shortcut menu can contain up to 499 commands. The command limit includes all menus in a hierarchy. If commands in the menu file exceed these limits [which is unlikely], the program ignores the extra commands. If a pull-down or shortcut menu is longer than the available display space, it is truncated to fit. When a pull-down or shortcut menu is truncated, two arrows are added to the menu; one is added at the top and another to the bottom. With the arrows, you can scroll the list of menu items up or down. The following table shows the properties for the File menu as they appear in the Properties pane. The properties for a pull-down menu and shortcut menu are identical.
Properties for the File menu
Properties pane item
Description
Example
Name
String used as the caption of the menu on the menu bar.
&File
Description
Text used to describe the element; does not appear in the user interface.
Aliases
Specifies the aliases for the menu. Click the [] button to open the Aliases dialog box. Each alias in the CUI file should be unique; and it is used to reference the menu programmatically.
POP1, FILE
Element ID
Tag that uniquely identifies a menu.
ID_MnFile
Pull-Down Menu Aliases
Pull-down menus should have one alias in the range of POP1 through POP499. Menus with an alias of POP1 through POP16 are loaded by default when a menu loads. All other menus must be added to a workspace to be displayed.
Topics in this section
- Create a Pull-Down Menu
You can create a pull-down menu, add a submenu, and add commands on the Customize tab of the Customize User Interface [CUI] Editor. The process is very similar to working with toolbars and flyouts with only minor differences.
- Create a Shortcut Menu
Shortcut menus are displayed at or near the location of your cursor when you right-click on the pointing device. The shortcut menu and the options it provides depend on the location of the cursor and other conditions, such as whether an object is selected or a command is in progress. You can also use scripts to display shortcut menus.
- Create Submenus
You create submenus in much the same way that you create a menu.
- Reference Pull-Down or Shortcut Menus
Using a method similar to that used to activate submenus, you can activate or deactivate another pull-down or shortcut menu. This is called referencing a menu.
- Swap and Insert Pull-Down Menus
Using the Customize User Interface [CUI] Editor, you can use workspaces to control the swapping of pull-down menus. However, you can also swap a pull-down menu programmatically [for example, when a user loads an application that requires an additional menu]. Menu swapping activates one menu directly from another menu.