# 9.

IDE Menu Reference

This chapter describes each command on each CodeWarrior IDE menu.

## IDE Menu Reference Overview

Menus used by Be applications appear inside the window on which they operate. Thus, each window type in the CodeWarrior IDE has a unique set of menus associated with it. The exception to this is the:

These menus appear in Editor windows:

- `File Menu`
- `Edit Menu`
- `Search Menu`
- `Project Menu`
- `Window Menu`
- `Add-ons Menu`

These menus appear in Project windows:
- `File Menu`
- `Project Menu`
- `Window Menu`

These menus appear in the Message window:

- `File Menu`
- `Edit Menu`
- `Window Menu`

The menu items in a specific menu are dependent upon the window in which it resides. For example, the File menu contains more menu items in an Editor window than it does within both the Project and Message windows.

## File Menu

The `File` Menu contains commands you use when creating new projects and files, saving, closing, and printing existing or new source code files and projects. The `File` Menu also provides a few different methods of saving edited files.

#### Figure 9.1 File menu differences

#### New Text

Creates a new editable text window.

To learn more about this command, refer to `"Creating a New File"` for more information.

#### New Project

Creates a new project file.

To learn more about this command, refer to `"Creating a Project."`

#### Open

This menu item opens a text or project file.

To learn more about this command, refer to `"Opening Files with the File Menu."`

#### Open File

This menu item allows you to open an existing text file, using the selected text in the editor window as the target file name.If no text is selected, the Open Selection window appears.

See `"Opening Files with the File Menu."` for more information.

#### Close

Closes the Editor, Project, or Message window. Clicking the Close box of the window does the same thing. If the active window is the Project window, Close saves the project before closing it.

If you close a source code file and have not saved your changes, CodeWarrior asks if you want to save your changes before closing the window (Figure 4.5). If you choose to close the source code file without saving your changes, all changes are lost.

#### Save

Saves the contents of the active Editor window to disk.

For more information, see `"Closing One File."`

#### Save As

Saves the contents of the active window to disk under another name of your choosing.

For more information, see `"Renaming and Saving a File."`

#### Save A Copy As

Saves the active Editor window or Project window in a new file. This command operates in two different ways, depending on whether a source code file or the Project window is active.

For more information, see `"Backing Up Files."`

#### Revert

Use the `Revert` command to revert the active Editor window to its last saved version.

#### Print

Prints files from CodeWarrior on your printer.

For more information on printing files, see `"Printing a Window,"` or read the documentation that came with your printer.

#### Print Setup

Enables you to choose the default printer used by the BeIDE to print.

#### About BeIDE

Choose this item to see the way-cool CodeWarrior About Box.

#### Quit

Quits CodeWarrior immediately provided one of the following conditions have been met:

- All changes to the open Editor files have already been saved, or
- The open Editor files have not been changed.
- A Build is not underway.

If a Project window is open, the `Quit` command saves all changes to the project file before the environment quits. If an Editor window is open and changes have not been saved, CodeWarrior asks if you want to save the changes before quitting.

## Edit Menu

The Edit menu contains all the customary editing commands and some CodeWarrior additions.

#### Undo

The text of these menu commands varies depending on the most recent action, and your Editor options settings.

`Undo` reverses the effect of your last action. The name of the `Undo` command varies depending on the type of operation you last executed. For example, if you have just typed in an open Editor window, the `Undo` command is renamed `Undo Typing`. Choosing the `Undo Typing` command will remove the text you have just typed.

### NOTE:

Multiple undo is also supported. This feature allows you to step backwards through your last steps to undo multiple changes.

To learn more about this topic, refer to `"Undoing the last edit,"`

#### Cut

Deletes the selected text and puts it in the Clipboard, replacing the contents of the Clipboard.

#### Copy

Copies the selected text in the active Editor window onto the system Clipboard. If the Message Window is active, the Copy command copies all the text in the Message Window onto the Clipboard.

#### Paste

Pastes the contents of the Clipboard into the active Editor window.

The `Paste` command replaces the selected text with the contents of the Clipboard. If no text is selected, the Clipboard contents are placed after the text insertion point.

If the active window is the Message Window, the `Paste` command is dimmed and cannot be executed.

#### Clear

Deletes the selected text without placing it in the Clipboard. The `Clear` command is equivalent to pressing the Delete or Backspace key.

#### Select All

Selects all the text in the active window. This command is usually used in conjunction with other `Edit` menu commands such as `Cut`, `Copy`, and `Clear`.

To learn more about selecting text, refer to `"Selecting Text."`

#### Balance

Selects the text enclosed in either parentheses (), brackets [], or braces {}. For a complete procedure on how to use this command and how to balance while typing, consult `"Balancing Punctuation."`

#### Shift Left

Shifts the selected source code one tab size to the left. The tab size is specified in the Preferences dialog box.

To learn more about this feature, refer to `"Shifting Text Left and Right."`

#### Shift Right

Shifts the selected source code one tab size to the right.

To learn more about this feature, refer to `"Shifting Text Left and Right."`

## Search Menu

This menu contains all the commands used to find text, replace text, and to find the definitions of routines in your source code.

#### Find

Opens the Find dialog box which is used to find and/or replace the occurrences of a specific string in one or many files.

To learn more about the Find window and its capabilities, refer to `"Guided Tour of the Find Window."`

#### Find Next

#### Find Previous

Finds the next occurrence of the `Find Text Box` string in the active window. This is an alternative to clicking the Find button in the Find dialog box.

Holding the Shift key down before choosing the `Search Menu` changes the command to `Find Previous`.

To learn more about this feature, refer to `"Finding Search Text."`

#### Find in Next File

#### Find in Previous File

Finds the next occurrence of the `Find Text Box` string in the next file listed in the Multi-File Search portion of the Find window (as exposed by the `Multi-File Search Disclosure Triangle` in the Find window). This is an alternative to using the Find window. If the Multi-File Search is not enabled as shown in `Figure 6.3`, this command is dimmed.

Holding the Shift key down before choosing the `Search Menu` changes the command to `Find in Previous File`.

To learn more about this feature, refer to `"Searching and Replacing Text in Multiple Files."`

#### Enter `Find' String

#### Enter `Replace' String

This command copies the selected text in the active window into the `Find Text Box`, making it the search target string. This is an alternative to copying text and pasting it into the Find window.

Holding the Shift key down before choosing the `Search Menu` changes the command to `Enter `Replace' String`. This command copies the selected text in the active window into the `Replace Text Box`, making it the search target string.

To learn how to select text, refer to `"Selecting Text."`

#### Find Selection

#### Find Previous Selection

Finds the next occurrence of the selected text in the active text editor window.

Holding the Shift key down before choosing the `Search Menu` changes the command to `Find Previous Selection`.

To learn more about this feature, refer to `"Finding Search Text."`

#### Replace

This command replaces the selected text in the active window with the text string in the `Replace Text Box` of the Find window. If no text is selected in the active editor window or there is no Replace string, this command is dimmed.

This command is useful if you wish to replace one instance of a text string without having to open the Find window. For example, say that you have just replaced all the occurrences of the variable "icount" with "jcount". While scrolling through your source code, you notice one instance of the variable "icount" is misspelled as "icont". To replace this variable with "jcount", select "icont" and choose the `Replace` command from the `Search Menu`.

To learn more about replacing text, refer to `"Replacing Found Text."`

To learn how to select text, refer to `"Selecting Text."`

#### Replace & Find Next

#### Replace & Find Previous

This command replaces the selected text with the text in the `Replace Text Box` string of the Find window, and then performs a `Find Next`. If no text is selected in the active editor window or there is no text in the `Find Text Box` string field of the Find window, this command is dimmed.

Holding the Shift key down before choosing the `Search Menu` changes the command to `Replace & Find Previous`.

To learn more about replacing text, refer to `"Replacing Found Text."`

To learn how to select text, refer to `"Selecting Text."`

#### Replace All

Finds all the occurrences of the Find string and replaces them with the Replace string. If no text is selected in the active editor window or there is no text in the Find string field in the Find dialog box, this command is dimmed.

#### Go Back

#### Find Definition

`Find Definition` searches for the definition of the selected routine within the source code files belonging to the open project. If it does not find the definition within your project's source code files, a system beep sounds. If the definition is found, CodeWarrior opens the source code file where the routine is defined and the routine name is highlighted. You can also use the Control Double-click as a shortcut for Find Definition.

If CodeWarrior finds more than one definition, a message window appears notifying you of multiple definitions. For more information on the Message window, consult `"Using the Message Window."`

Go Back returns you to the previous position after using Find Definition to find a symbol definition.

#### Go To Line

Opens a dialog (in which you enter the line number) and then moves the text insertion point to the line.

For more information about this feature, refer to `"Going to a Particular Line."`

## Project Menu

The Project menu lets you add and remove files and libraries from your project. It also lets you compile, build, and link your project. All of these commands are covered in this section.Add to Project

This command adds the file in the active Editor window to the open project.

This command is only available in an Editor window.

To learn more about this feature, refer to `"Using the Add to Project Command."`

#### Add Files

This command allows you to add files to the Project window.

This command is only available in the Project window.

To learn more about this feature, refer to `"Using the Add Files Command."`

#### Remove Files

This command removes the selected files and groups from the project window. Removing all the files from a group removes the group.

This command is only available in the Project window.

To learn more about removing files from projects, consult `"Removing Files and Groups."`

### WARNING!

This command cannot be undone.

#### New Group

This command creates a new group in the project window.

This command is only available in the Project window.

To learn more about adding groups to projects, consult `"About Groups and Segments."`

#### Remove Group

Use this command to remove the currently selected group from the project window.

This command is only available in the Project window.

To learn more about removing groups from projects, consult `"Removing Files and Groups."`

#### Compile

This command compiles selected files. If the project window is active, the selected files and groups are compiled. If a source code file in an Editor window is active, the source code file is compiled. The source code file must be in the open project.

To learn more about this topic, refer to `"Compiling and Linking a Project."`

#### Check Syntax

This command checks the syntax of the source code file in the active Editor window or the selected file(s) in the open Project window. If the active Editor window is empty, or no project is open, this command is dimmed.

`Check Syntax` does not generate object code. This command only checks the source code for syntax errors. To abort this command at any time, press Alt-Period.

If one or more errors are detected, the Message window appears. For information on how to correct compiler errors, consult `"Correcting Compiler Errors and Warnings."`

#### Bring Up To Date

This command updates the open project by compiling all of its modified and "touched" files.

To learn more about this topic, refer to `"Updating a Project."`

#### Link

This command links the selected project by linking the modified files in the open project.

#### Make

This command builds the selected project by compiling and linking the modified files in the open project. The results of a successful build depend on the selected project type.

To learn more about this topic, refer to `"Making a Project."`

#### Precompile

This command precompiles the source code file in the active Editor window into a precompiled header file.

To learn more about this topic, refer to `"Using Precompiled or Preprocessed Headers."`

#### Preprocess

This command performs C/C++ preprocessing on selected files.

To learn more about this command, refer to `"Preprocessing Source Code (C/C++ only)."`

#### Disassemble

This command disassembles the compiled source code files selected in the project window, and displays object code in new windows with the title of the source code file and the extension .dump.

To learn more about this feature, refer to `"Disassembling Source Code."`

#### Remove Objects

This command removes all compiled source code binaries and deletes all `.o` files from the open project. The numbers in the `Code Column` and `Data Column` of each file are reset to zero.

This command is only available in the Project window.

To learn more about this topic, refer to `"Removing Objects."`

#### Reset File Paths

This command resets the cached locations of source files belonging to the open project. This command is useful if, for example, you move one of the project's files to a different location on your drive.

This command is only available in the Project window.

#### Enable Debugger

This command is only available in the Project window.

To learn more about this topic, refer to `"Controlling Debugging in a Project."`

#### Disable Debugger

Launches your project directly instead of using the debugger. This command does not reset preferences set by the `Enable Debugger`command.

This command is dimmed if the active project does not create an application.

This command is only available in the Project window.

To learn more about this topic, refer to `"Controlling Debugging in a Project."`

#### Run

This command builds the selected project by compiling and linking the modified and "touched" files in the open project. The results of a successful build depend on the selected project type.

To learn more about this topic, refer to `"Running a Project."`

#### Debug

This command compiles and links your project and then opens the project's debugger file with the Metrowerks Debugger. This command runs the Metrowerks Debugger for any project that the debugger can work with.

This command is only available in the Project window.

To learn more about the CodeWarrior Debugger, refer to the Debugger for BeOS Manual.

## Window Menu

The Window menu includes commands that tile open editor windows, switch between windows, and reopen previously opened projects.

#### Stack

This command opens all Editor windows to their full screen size and stacks them one on top of another, with their window titles showing.

#### Tile

This command arranges all Editor windows so that none overlap.

#### Tile Vertical

This command arranges all the Editor windows vertically.

#### Zoom Window

Ths command expands the active window to the largest possible size. If you choose it again, it returns the window to its original size.

#### Recent Projects

This command allows you to reopen a project that was previously opened then closed. Using this command closes your current project before reopening the newly-selected project.

To learn more about this feature, refer to `"Using the Recent Projects List."`

#### Settings

Use this command to change the global preferences used by the CodeWarrior IDE and the settings for current and new projects.

To learn more about configuring Project Settings, refer to `"Project Settings Panels."`

#### Message Window

This command opens and brings the Errors and Warnings window to the front.

To learn more about this window, refer to `"Guided Tour of the Message Window."` Also, refer to `"Using Batch Searches."`

#### Other Window Menu Items

The other Window Menu items depend solely on which project, source files, header files, and other windows you have open.

All of the open files are shown in this menu and the first nine files (1 through 9) are given key equivalents. The current project is always given the Alt-0 (zero) combination.

To make one of your open CodeWarrior files active and bring its window to the front, you can do one of the following:

- Click in its window.
- Select it in the `Window Menu`.
- Use the key equivalent shown in the `Window Menu`.

## Add-ons Menu

The Editor Add-ons menu contains a list of Editor plug-ins that are added to the menu bar. Editor plug-ins must reside in a folder called `plugins` in the same folder as CodeWarrior in order to be found and used by the CodeWarrior IDE.

#### Commenter

The Commenter tool converts all selected source code lines in an Editor window to commented lines using C++ style comments (//).

To comment line:

1. Select the lines to comment.

Source code lines are highlighted in the Editor window.

2. Comment lines.

Choose the Commenter menu item under the Add-ons menu. Selected lines are commented using the C++ style (//).

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: support@metrowerks.com
Copyright © 1998, Metrowerks Corp. All rights reserved.
Last updated: February 15, 1998
* Chris Magnuson * John Roseborough