Customizing Menus

Menu Principles

Creating or customizing the CC3 menu is easy—all you need is a plain text editor like Notepad. CC3 lets you change the number, order, title, and function of any menu item You can change the arrangement of the existing commands, add your own default values to streamline their operation, or add your own macro commands, symbols, and parts.

When you start CC3, it loads pull-down menus from a standard menu file named fcw32.mnu. Take a look at it with your text editor (and making a backup copy might be a good idea in case you ever need to restore the original .mnu file). Each line in the menu file follows this basic syntax:

·   A label (the word or words you see in the pull-down menu);

·   A colon (:) separator between the label and the data;

·   Optional data, which can be a command or series of commands and/or parameters (responses to prompts).

If the menu item includes no menu data (just a label followed by a colon), CC3 uses it as a menu title (one of the words like FILE and DRAW that appears in the menu bar at the top of your screen).

Creating Sub-Menus

To create a sub-menu (sometimes called "sidebar menus" or "daughter menus"), end the label with the greater than (>) sign, then precede each item in the sub-menu with at least one space. For example:

 Lines>:

Line:|LINE;

Double Lines:|DBLN;

Creating Menu Commands

When you select a command from a menu, CC3 interprets the menu data exactly as if you had typed it at the keyboard. For example, to use the SCALE COPY command, you could type SCLCPY and press ENTER. In the menu file, the SCALE COPY command looks like this:

Scaled Copies:|SCLCPY;

·   Scaled Copies is the menu label. CC3 automatically scales the width of the menu to the longest label. To improve readability, you may pad the label entry with spaces to visually align menu items.

·   :, the colon, is the menu separator. It tells CC3 where the menu label ends and the menu data begins.

·   |, the vertical bar, in a menu acts like ESCAPE to cancel commands still in progress when the menu item is selected. Its use is optional, but you will find this character in all the non-transparent commands in fcw32.mnu.

·   ~ (the tilde) is used before transparent commands

·   SCLCPY is the actual CC3 command. It does not have to be capitalized, but doing so makes reading the menu file easier.

·   ;, the semicolon at the end of the line, is a delimiter. It tells CC3 that you have finished typing a command or response. The ENTER key, the SPACEBAR, and the semicolon are all delimiters—they mean exactly the same thing to CC3. However, CC3 ignores ENTER in a menu file. For maximum readability, use spaces or semicolons between commands and semicolons at the end of a menu item.

Including Parameters in Menu Commands

Menu data can include parameters (responses to CC3’s prompts and dialog boxes). Here’s an example:

Zoom In:ZIN 10;

Note the 10 added after the CC3 command, ZIN . This automatically answers the "zoom scale:" prompt you would have otherwise seen.

You might have also noted that this command does not have the vertical bar ("|") character. That’s because ZOOM IN is meant to be a transparent command that can be invoked during another command. If the "|" character was present, a draw or editing command would terminate as soon as you tried to ZOOM IN.

If you wish, you can actually try applying this example of menu parameters in the exercise that immediately follows.

Modifying the Pull-Down Menus

In this example of re-labeling an existing command, you will change the menu label for the ZOOM IN command to WAY IN, and add a parameter to make the command zoom in 10 times closer.

Make a backup copy of fcw32.mnu.

Open the file fcw32.mnu in Notepad or any other Windows or DOS text processor. (You can use word processor programs like WordPad, but recognize that fcw32.mnu is a plain text files. Saving the .mnu file in a word processing file format will introduce many special formatting codes that CC3 will not know how to handle. Make sure you save files in text format.)

Find this line. (It’s on or near Line 37.)

Zoom In :ZIN;

Don’t worry any extra spaces before the colon separator. They are present simply for readability purposes; they have no functional effect. You can add or delete the spaces, but do not use the TAB key. TABs are used to define accelerator keys.

Change it to read:

WAY IN :ZIN 10;

Save the menu file in a text format with the same name.

Now start CC3 . Load any drawing or draw some random entities on the screen, then pull down the VIEW menu—notice the new menu label. Select WAY IN—it should immediately zoom in 10 times closer.

Close CC3 and restore the original menu file.

If you wish to add a separator line in any pull-down or sub-menu, add the following line where you wish it to appear (using 12 dashes and a colon):

 ------------:

Accelerator Keys

To define an accelerator key equivalent for a command, use the TAB key as the unique delimiter. Accelerator keys do not work while a menu is pulled down. A few examples:

Save[TAB]^S:SAVE;

Displays

Save CTRL+S

Line[TAB]F12:LINE;

Displays

Line F12

Point[TAB]CF9:POINT;

Displays

Point CTRL+F9

Box[TAB]SF11:BOX;

Displays

Box SHIFT+F11

Path[TAB}SCF8:PATH;

Displays

Path SHIFT+CTRL+F8

Note that when defining CONTROL key shortcuts with letters, you must use the caret character (^) to indicate the CTRL key. For example, to create a CTRL+R shortcut for REDRAW, modify the menu entry as follows:

Redraw ^R:|REDRAW;

Keep in mind that you must use the TAB key to separate Redraw and ^R .

You can not use the F1, F10, or ALT keys in any combination (Windows reserves these keys for its own use). Note that when defining function keys, the letter "C" can be used to represent the CTRL key, and the letter "S" represents the SHIFT key. The letters "SC" indicate SHIFT+CTRL. If duplicate definitions exist in a menu file, the definition closest to the end of the file will be used.

User Prompts

In menu items (as well as macros and scripts), the sequence:

^Dprompt

displays the prompt text (ended with a Carriage Return only!) and waits for live input.

^D keeps the appropriate cursor and allows an entire pick cycle (MOVE ^D 0,0 1,1).

^D can be interrupted by a modifier or zoom command from the menu/toolbar, but only if the menu file has a ^D following each command line input item. Look at the modifiers and icons in fcw32.mnu.

^D forces live input for an entire getdata, which may be more than one point. For example, BOX ^D not BOX ^D ^D. The exception to this rule is found with the modifier INTERSECTION OF. Two ^D's are needed because two different entities are requested.

Right now, any ^D that doesn't have a prompt spelled out "inherits" the prompt from the last ^D that had one, even if that one is in a completely different macro!

Because loading a menu replaces the existing menu table in memory, CC3 ignores everything in a menu item after MENUM <filename.mnu>.

Related Topics

The Macro menu