Creating context menus

The availability of context aka shortcut menus is controlled through the SHORTCUTMENU system variable. There are three context menu modes:

  • Default mode: Displays the Default context menu when no command is active and nothing is selected.
  • Edit mode: Displays the Edit context menu when a selection set exists. This mode is context sensitive. If a specific shortcut menu for the selected entity or entities exists, its content is added to the Edit context menu. For example, the content of the Multiline Text Object context menu is available in the Edit context menu when an MText entity is selected.
  • Command mode: Displays the Command context menu when a command is running.

Shortcut menus appear when you right-click. However:

  • When bitcode 16 of the SHORTCUTMENU system variable is set, a right-click repeats the previous command and you need to hold down the right mouse button longer (= long right-click) to display shortcut menus.
  • When bitcode 4 of the QUADDISPLAY system variable is set (= Show Quad on right-click), shortcut menus only show when bitcode 16 of the SHORTCUTMENU system variable is set.

Special shortcut menus are:

  • Grips: Appears on a right-click when using grips to edit an entity.
  • Entity Snap:
    • MBUTTONPAN = OFF: appears when you click the mouse wheel (middle mouse button).
    • MBUTTONPAN = ON: displays on Shift + Right-Click

Creating shortcut menus

  1. In the Customize dialog, click the Menus tab.
  2. Do one of the following:
    • Click the Context Menus subgroup of a menu group, then right-click and choose Append context menu in the context menu.

      The new context menu will be added below the last existing context menu.

    • Select an existing context menu in the Context Menus subgroup, then right-click and choose Insert context menu in the context menu.

      The new context menu will be added above the selected context menu.

    The Add Context Menu dialog box appears.

  3. Type a name in the Menu title field.
  4. (option) To create a regular context menu:
    • Choose As regular context menu.
    • Click the Add Context… button.

      The Add context alias dialog box appears.

    • Select a context alias. The options are: CMCOMMAND, CMDEFAULT, CMEDIT, GRIPS and SNAP.

      This controls when the context menu is available. See above.

    • (option) add another context alias.
    • Click the OK button to create the context menu.
  5. (option) To create a context sensitive context menu:
    • Choose As context menu on specific entities.
    • Click the Add Entity Types… button.

      The Add Entity Alias dialog appears.

    • Tick the One entity and/or Multiple entities boxes.
    • Select one or more entities in the list, then click the OK button.
    • (option) Click the Add Custom… button add a custom alias.
    • Click the OK button to create the context menu.
  6. Add tools to the context menu.