[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Editor Preferences

This section discusses the preference panels that control CodeWarrior editor features:


Editor Settings

The Editor Settings preference panel, shown in Figure 8.16, provides options for configuring the CodeWarrior editor's behavior.


Remember

The Remember options control the settings that the editor remembers between editing sessions.


Font preferences

Enable this checkbox to configure the font information for an individual file. Disable the checkbox to allow all files to inherit the default font settings from the CodeWarrior IDE.


Selection position

Enable this checkbox to allow the IDE to remember the visible part of a file's text, the location of the insertion point, and any selections that were made. Disable the checkbox to force the editor to go to the first line of each opened source-code window. This feature requires writable files. To learn more about writable files, see "Common VCS Operations".

Editor Settings Preference Panel:

Window position and size

Enable this checkbox to save each window's position and size so that it always reappears at the same location on the screen. This feature requires writable files. To learn more about writable files, see "Common VCS Operations".


Contextual Menus

The Contextual Menus options toggle the display of specific types of menu commands in the IDE's contextual menus.


Edit commands

Enable this checkbox to display commonly used menu commands from the Edit menu. See "Edit Menu" for more information.


Browser commands

Enable this checkbox to display commonly used menu commands from the Browser menu. See "Browser Menu" for more information. After you enable this checkbox, you can also enable the Insert Template Commands checkbox to display templates from your source code. The contextual menus then display the Insert Template command, shown in Figure 7.4. If necessary, this command displays a submenu that lists the templates.


Project commands

Enable this checkbox to display commonly used menu commands from the Project menu. See "Project Menu" for more information.


VCS commands

Enable this checkbox to display commonly used menu commands from the VCS menu. See "VCS Menu" for more information.


Debugger commands

Enable this checkbox to display commonly used menu commands from the Debug menu. See "Debug Menu" for more information.


Other Settings

The Other Settings control miscellaneous behaviors that the editor remembers between programming sessions.


Balance while typing

Enable this checkbox if you want the IDE to check for balanced parentheses, brackets, and braces as you type. Each time you type a closing parenthesis, bracket, or brace, the editor attempts to locate the matching opening counterpart. When successful, the editor brings the matching counterpart into view, highlights it for a specified length of time (the Balance Flash Delay), and then returns to where you were typing. If the editor fails to find a matching counterpart, a beep sounds. By default, the Balance while typing checkbox is enabled. See "Balance Flash Delay" for more information.


TIP

If you do not want to highlight balanced punctuation, set the Balance Flash Delay to 0.

Use multiple undo

Enable this checkbox to undo and redo multiple actions. Disable the checkbox to undo or redo only the most recent action. See "Redo" and "Undo" for more information.


Relaxed C popup parsing

Enable this checkbox to allow the CodeWarrior IDE to recognize the Kernighan and Ritchie style coding conventions in your source code and properly display function names in the Routine pop-up menu (see "Function Pop-Up Menu"). Disable the checkbox if you use non-standard macros that can interfere with Kernighan and Ritchie conventions. For more information, refer to "Reference Manual," of The C Programming Language, Second Edition (Prentice Hall) by Kernighan and Ritchie.


NOTE

With the Relaxed C popup parsing checkbox enabled, the IDE cannot recognize some macro functions. If you encounter problems while viewing routine names, disable this checkbox and try again.

Enable virtual space

Enable this checkbox to use virtual spaces in the editor. With virtual spacing enabled, you can use the arrow keys to move the text-insertion point past the end of a line of source code. The editor automatically inserts spaces between the former end of the line and newly entered text.


Left margin click selects line

This checkbox configures cursor behavior in the left margin of all editor windows:

If the checkbox is enabled, moving the cursor to the left edge of an editor window changes the cursor's icon to a right-pointing arrow. Clicking the left margin with this cursor selects the line next to the cursor. Dragging the right-pointing arrow along the left margin selects more than one line.

If the checkbox is disabled, the cursor's icon is an I-beam. You cannot use this cursor to select an entire line with a click.


Sort function popup

Enable this checkbox to alphabetically sort the items listed in the Function pop-up menu. See "Function Pop-Up Menu" for more information.


Balance Flash Delay

Enter in this field the number of ticks that the CodeWarrior editor should display and highlight an item. Each tick represents 1/60th of a second (16.67 milliseconds). This option applies to balancing punctuation. For more information, see "Balancing Punctuation" and "Balance while typing."


WARNING!

If you enter 0 in the Balance Flash Delay field, the IDE completely disables flashing the balanced punctuation. To restore the flashing, enter a number greater than 0.

Default file format

Use this pop-up menu to configure the default end-of-line conventions that the CodeWarrior IDE uses to save files. You can choose one of three formats: Macintosh, DOS, or Unix. For more information, see "Document Settings Pop-Up Menu."


Font & Tabs

The Font & Tabs preference panel, shown in Figure 8.17, provides options for configuring font and tab preferences in editor windows.The preferences in this panel apply to the active editor window. If no editor windows are currently open, the saved preferences become default settings in the CodeWarrior editor.

Font & Tabs Preference Panel:

The editor restores your font and tab preferences each time you open the text file. This feature requires writable files. To learn more about writable files, see "Common VCS Operations".


Font

Use this pop-up menu to choose your desired text font.


Size

Use this pop-up menu to choose your desired font size.


Sample

This field shows sample text that reflects the current settings in the Font and Size fields.


Document Tab Settings

These options control the use of tabs within the CodeWarrior editor.


Auto Indent

Enable this checkbox to automatically create a new line with the same indentation as the previous line.


Tab Size

Enter in this field the number of spaces that you wish to represent the width of a tab.


Global Tab Settings

These options control the use of tabs throughout the IDE.


Tab indents selection

This checkbox controls the way the IDE inserts tabs into text. If the checkbox is enabled, you can select lines of text and press the Tab key to insert a tab in front of each selected line, indenting the existing text. If the checkbox is disabled, the IDE completely replaces the selected lines with tabs. The checkbox is enabled by default.


Tab Inserts Spaces

Enable this checkbox to insert spaces in the text after you press the Tab key. Use the Tab Size field to specify the number of inserted spaces.


Script (Windows)

Use this pop-up menu to choose your desired script system (language).


Text Colors

The Text Colors preference panel, shown in Figure 8.18, configures text coloring in IDE windows.


Text Colors

The following options control color settings for IDE windows.

Text Colors Preference Panel:

Foreground

This option configures the color of any text not affected by the options in the Activate Syntax Coloring or Activate Browser Coloring sections. Click the color swatch to change the current color.


Background

This option configures the color of the areas on which text appears. Click the color swatch to change the current color.


Activate Syntax Coloring

Enable this checkbox to configure the color of comments, keywords, strings, and custom sets of keywords in editor windows. Table 8.1 describes each of these elements. Click the color swatch beside the desired element to change the current color.

Syntax Coloring Elements:

Element
Description
Comments  
Code comments. In C, C++, and the Java programming language, you can place comments between /* and */ or from // to the end of a line.  
Keywords  
The programming language's keywords. This element does not include macros, types, variables defined by system interface files, or variables that you define.  
Strings  
Anything that is not a comment, keyword, or custom keyword. Sample strings include literal values, variable names, routine names, and type names.  
Custom Keywords  
Keywords listed in a custom keyword set. You can define four distinct sets and assign a unique color to each set. For example, you can define a custom keyword set of functions, types, and other names that you want to highlight with a unique color.  

For more information about custom keywords, see "Defining custom keyword sets" and "Importing and exporting custom keywords". For more information about toggling syntax coloring for individual files, see "Document Settings Pop-Up Menu."


Defining custom keyword sets

You can define a collection of keywords to which you can assign a unique color. This custom keyword set can include functions, types, and other names that you want to highlight with a particular color. You can define up to four global custom keyword sets that apply to every editor window. You use the Custom Keywords dialog box to define, modify, export, and import the sets for use within the IDE.

To add a keyword to a custom keyword set, follow these steps:

1. Click the Edit button next to the custom keyword set that you wish to modify.

The four custom keyword sets appear in the Text Colors preference panel (Figure 8.18). After clicking Edit, the Custom Keywords dialog box appears (Figure 8.19).

2. Enter in the topmost field of the Custom Keywords dialog box the keyword that you wish to add.

For example, enter restartApplet in the topmost field, as shown in Figure 8.19.

Custom Keywords Dialog Box:

3. Click Add.

The IDE adds the new custom keyword to the custom keyword list. The custom keyword list in Figure 8.19 already contains startApplet.


NOTE

Due to the way the IDE handles custom keyword lists, you might not be able to add additional keywords to an already large list. After the IDE fails to add a keyword to the existing list, an error message appears.

Repeat these steps until you finish adding keywords to the custom keywords list. If you want the IDE to match the case of each keyword in the list when applying your color settings, enable the Case Sensitive checkbox. Click Done to save your changes and close the Custom Keywords dialog box. Click Cancel to discard your changes and close the dialog box.


TIP

You can also set target-specific colors for custom keywords. See "Custom Keywords" for more information.

To delete a keyword from a custom keyword set, follow these steps:

1. Ensure that the Custom Keywords dialog box is open.

See "Defining custom keyword sets" for more information about opening this dialog box.

2. Select the keyword that you wish to delete.

3. Delete the keyword.

Press the Backspace key (Windows, Solaris, and Linux) or Delete key (Mac OS). The CodeWarrior IDE removes the custom keyword from the custom keyword list.

Repeat these steps until you finish deleting custom keywords. Click Done to save your changes and close the Custom Keywords dialog box. Click Cancel to discard your changes and close the dialog box.


Importing and exporting custom keywords

You can import existing custom keyword sets for use in the IDE, and you can export your sets for use on another IDE host.

To import a custom keyword set, follow these steps:

1. Click the Edit button next to the custom keyword set into which you wish to import new keywords.

The four custom keyword sets appear in the Text Colors preference panel (Figure 8.18). After clicking Edit, the Custom Keywords dialog box appears (Figure 8.19).

2. Click Import from file.

A standard Open dialog box appears.

3. Use the dialog box to select the custom keyword set that you wish to import.

4. Click Open.

The IDE imports the selected custom keyword set and adds its keywords to the custom keywords list.

5. Click Done.

The imported custom keywords become part of the custom keyword set.

To export a custom keyword set, follow these steps:

1. Click the Edit button next to the custom keyword set that you wish to export.

The four custom keyword sets appear in the Text Colors preference panel (Figure 8.18). After clicking Edit, the Custom Keywords dialog box appears (Figure 8.19).

2. Click Export to file.

A standard Save dialog box appears.

3. Use the dialog box to save the exported custom keyword set.

If you plan to use the exported custom keyword set on a different host, add a ".txt" extension (without the quotes) to the set's name. The Windows-hosted IDE requires this extension in order to identify the custom keyword set.

4. Click Save.

The IDE exports the custom keyword set and saves it.

5. Click Done.


Activate Browser Coloring

Enable this checkbox to configure the color of different types of browser symbols. Click the color swatch beside the desired symbol to change the current color.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000