The Tornado source-code editor includes standard text manipulation capabilities, as well as the following specialized features:
The Tornado editor also provides features tailored to the programming environment. You can have the editor display program syntactic elements such as C or C++ keywords, preprocessor directives, and comments in color. Because the editor is integrated with the Tornado debugger (10. Debugger), the editor also keeps pace automatically with program execution during debugging sessions.
You can work on as many files simultaneously as your computer's memory allows. This is convenient when you are working with more than one module, or want to edit both a source and header file at the same time.
Typically, developers use the Tornado editor to work with source files, header files, and makefiles. However, because it is a text editor, it can also be used on any text file. For example, you can view a bug report from one of your users, or save a note in a text file.
The Tornado editor uses standard Windows editing commands and conventions. In describing the features and usage of the editor, we assume you are already familiar with these conventions.
The Standard toolbar has buttons for frequently used editing commands that are also available in the File and Edit menus. Figure 3-1 shows the Standard toolbar as a floating palette.
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
|
Create a new document. See 3.3.1 Creating a File.
|
|||||||||||||||||||
|
Open an existing document. See 3.3.2 Opening a File.
|
|||||||||||||||||||
|
Save the current document. See 3.3.3 Saving and Closing a File.
|
|||||||||||||||||||
|
Delete the selection and place it in the clipboard. See 3.4.2 Editing Text.
|
|||||||||||||||||||
|
Copy the selection to the clipboard. See 3.4.2 Editing Text.
|
|||||||||||||||||||
|
Insert the clipboard text at the insertion point. See 3.4.2 Editing Text.
|
|||||||||||||||||||
|
Print the document. See 3.4.5 Printing.
|
|||||||||||||||||||
|
|
|||||||||||||||||||
Commands in the File menu include: file management commands, printing commands, recently-opened files, and the Exit command.
The following sections describe these commands. Each section begins with a table that summarizes the buttons (if any) and keyboard shortcuts for the commands described in that section. For information about printing, see 3.4.5 Printing.
To create a new file, click File>New. A dialog box (Figure 3-2) appears where you can select the type of file you want to create. The file type you select controls such default parameters as color keywords. To enter plain text, you can use any file type.
When you select a file type, an empty window appears, ready for you to begin entering text. Figure 3-3 shows a new file window for type Source File (the type for C or C++ source, including header files).
The area at the left margin is called the attribute pane. Only the Source File file type includes an attribute pane in its display. The attribute pane indicates breakpoints and the target-program context when you use the debugger. You can turn the attribute pane off (among other editor options) from Tools>Options>Editor (see 12.3.2 Editor Preferences). If there is no attribute pane, the debugger highlights an entire line of source code to show the location of a breakpoint and to show where the program has stopped. (You can control the color used for such highlighting; see 12.3.6 Fonts/Colors.)
To open an existing file, click File>Open. A standard Windows file browser (Figure 3-4) allows you to select what file to open.
To write out the current file, click File>Save. To specify a new name (or path) for the current file, click Save As instead. (Save is disabled until you modify the current file.)
Click Close to dismiss the editor window for the current file. If the file has changed since you last saved, a confirmation dialog box offers you the opportunity to save the file before closing it.
Only one of the edit windows in Tornado is active at any one time. The active window contains a text cursor, a blinking vertical line also called an insertion point. Whatever you type appears at the text location indicated by the text cursor.
The editor is designed for editing source files. As such, it does not provide the "word wrap" feature found in many word processors. You must press ENTER to start a new line. If a line is too long for the current width of the edit window, the text scrolls horizontally as necessary to display the portion of the line you are editing.
There are two editing modes in Tornado: overtype mode, which replaces the existing text under the cursor as you type, and insert mode (the default), which displaces text to the right while adding the characters you type. Use the INSERT key on your keyboard to toggle between these two modes. The indicator OVR appears in the status line at the bottom of the Tornado window when overtype mode is on. The editing mode does not change when you switch edit windows; the last mode you selected continues to apply, even if you switch to a window that you last edited with the other editing mode.
The Edit menu supports the Windows standard editing functions: Undo, Cut, Copy, Paste, Delete, and Select All, with standard shortcuts.
The Undo command reverses the effects of the most recent change; click the command again to reverse the change before that. The editor supports up to 512 levels of undo history; you can set how much history to save (among other editor options) by clicking Tools>Options>Editor (12.3.2 Editor Preferences).
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
The Go To command in the Edit menu displays a dialog box that allows you to specify, by line number, what portion of the file to view.
The Next Error/Tag and Previous Error/Tag commands are enabled when errors or warnings are displayed in the Build Output window. In that situation, click these commands to examine the source-code context for each error or warning in turn. See 4.3.4 Building a Downloadable Application for more information.
The editor uses the standard Windows keys and mouse actions for moving throughout the file.
Click Edit>Find to search for a string in your file. You can also open the Find dialog box with CTRL+F or ALT+F3. Figure 3-5 shows the Find dialog box.
Enter the string you are looking for, set the options, and click OK. The option buttons under Direction determine whether the editor searches back (Up) from the cursor position, or forwards (Down). If the text is not found, the editor displays an error message; the Find dialog box remains open, in case you need to correct the search string.
Click Find Next to search for another instance of the same string in the same search direction; click Find Previous to repeat the search, but in the opposite direction.
Click Replace to specify both a string to find and a replacement for it. Figure 3-6 shows the Replace dialog box. The buttons in the Replace dialog box allow you to replace all occurrences of a string, or examine each individual occurrence before deciding whether or not to replace it.
To print the current edit window, click File>Print. A standard Print dialog box (Figure 3-7) appears.
Click Page Setup to change the text that appears at the top (Header) and bottom (Footer) of each page in printouts from the Tornado editor. The dialog box in Figure 3-8 allows you to specify the header and footer text.
In the Header and Footer boxes of the Page Setup dialog box, you can use the character sequences in Table 3-2 to request timestamps or file names and to control alignment.
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
|
|
|||||||||||||||||||
You can customize the editor by specifying fonts, colors, and options such as tab stops, scrollbar displays, and the number of levels of undo history. See 12.3 Setting Options for details.
You can also select an alternate editor for use with Tornado. See 12.3.3 External Editor.