Contained Within
Find More Documentation
Featured Support Resources
| Scarica il manuale in formato PDF
Typing and Editing
9
- This chapter describes how you can type and edit documents. Most of the examples show Solaris(TM) OpenStep's(TM) Edit application, but any application that uses text, including the File Viewer and Mail, will use these editing techniques. The techniques work in text areas of any size, from file names in the File Viewer to Mail messages to large documents produced in Edit:
-
- Starting the Edit application
- Typing text
- Selecting text
- Deleting and replacing text
- Moving and copying text
- Finding text
- Replacing text that you find
- Typing special characters
- Previewing special characters
- Setting a new font
- Previewing a font
- Setting margins, indentation, and tabs
- Checking your spelling
Starting the Edit Application
- The Edit application is a tool for creating formatted documents. You can start Edit with its icon in the dock or by opening an RTF file (one with an .rtf or .rtfd extension) from the File Viewer (see Figure 9-1 on page 9-2).
-
* Double-click on the Edit icon in the dock.
- or
-
* Open the /usr/openstep/Apps folder in the File Viewer and then double-click on Edit.app.
- or
-
* Double-click on the icon for an RTF or RTFD file.

Figure 9-1
- You create an Edit document in a document window. When you start up Edit from the application dock, an empty document window like the one in Figure 9-2 on page 9-3 appears. When you start up Edit by clicking on a file icon, the file is opened in a document window. A window with a document in it looks like the one in Figure 9-3 on page 9-4. You can also open a new document window by choosing New from the File menu.

Figure 9-2
- For information on naming an Edit document, see Chapter 5, "Creating and Saving Files."
- You can add color or graphic images to a document. See Chapter 10, "Working With Color," and Chapter 11, "Working With Graphics."
Typing Text
- You type text in a document or text field using the keyboard (see Figure 9-3 on page 9-4). As you type each character, it appears in the key window at the insertion point.
-
-
Click in the window where you want to type.
-
Type without pressing Return at the end of each line.
-
Press Return to end each paragraph.
-
Click elsewhere to continue typing there.

Figure 9-3
- To move the insertion point and select a new place to type, click where you want the text to be displayed (see Figure 9-4).

Figure 9-4
- You can also move the insertion point with an arrow key on the keyboard.
- You do not have to press Return to end a line as you do on a typewriter. Applications automatically break lines between words (a process known as word wrap). You only press Return to cut a line short, as when ending a paragraph.
Keyboard Basics
- Most keys on your keyboard are labeled with letters, numbers, punctuation, or other symbols that the keys generate when you press them (see Figure 9-5).

Figure 9-5
-
- Holding down the Shift key while typing another key gives you either uppercase letters or the upper characters on keys labeled with two characters. On most keyboards, you can press Caps Lock if you want to type uppercase letters without holding down the Shift key. To turn off Caps Lock, press the key again.
- Press the space bar to insert a space between two characters.
- Press Return to end a paragraph or begin a new line. In some panels, pressing Return operates a button.
- Press Tab to move to the next tab stop in a document or to the next text field in a panel. Sometimes, holding down Shift while pressing Tab moves you in the reverse direction--for example, to the previous field in a panel.
- To delete text, press the Back Space key, which backs up over text one character at a time.
- On a Sun keyboard, the ·and Alt keys work as your Command key and Alt key, respectively. On the x86 keyboard, the key labeled "Alt" to the left of the space bar is the Command key, and the key labeled "Alt" to the right of the space bar is the Alt key. Several uses for these keys are given throughout this book.
-
- When you hold down a key, the character repeats itself. You can use the Preferences application to adjust the repetition speed. See "Setting the Rate for Repeating Characters" on page 16-6.
- The numeric keypad provides a convenient way to enter numbers and do calculations. There is no difference between typing the same character here and on the main part of the keyboard.
- Finally, if you type when there is no key window or if the key window does not accept typing, your system beeps so you know that your keystrokes are not having any effect.
Selecting Text
- To edit text, you usually select it first, as shown in Figure 9-6. Your next action, such as choosing the Delete command, acts on the selection.
-
* Drag across the text you want to select.
-
* Hold down the Alt key while clicking to select a range between the insertion point and where you click.
-
* Double-click on a word to select it.
-
* Triple-click anywhere in a paragraph to select the whole paragraph.
- One way to select text is to drag across it. Drag horizontally to select text on the same line or vertically to select several lines of text. You can even drag past the edge of your view--for instance, past the bottom of an Edit window--to scroll the window's contents and keep selecting.

Figure 9-6
- The Alt key is useful for selecting large amounts of text, as shown in Figure 9-7 on page 9-7. You can even scroll beforehand to select more than is currently displayed.

Figure 9-7
- If you select text by double-clicking or triple-clicking on it, you can drag before releasing the mouse button the final time to extend the selection by a word or paragraph at a time. If you then Alt-click, the selection is extended to the next word or paragraph boundary.
Deleting and Replacing Text
- Pressing the Back Space key as you type backs up and deletes characters one at a time. When text (or a graphic image) is selected, the Delete command in the Edit menu and the Back Space key do the same thing--they delete the selection (see Figure 9-8 on page 9-8).
-
* To delete text as you type, press the Back Space key.
-
* To delete a block of text, select it. Then choose Delete from the Edit menu or press the Back Space key.
-
* To replace text, select it. Then type the replacement text.

Figure 9-8
- When you delete a word that you selected by double-clicking on it, spacing is automatically adjusted around the remaining words. For instance, if you double-click on the word automatically in the first sentence of this paragraph and then delete it, one space remains between is and adjusted instead of two.
Moving and Copying Text
- You can move and copy text with the Cut, Copy, and Paste commands in the Edit menu, as shown in Figure 9-9. In applications where you work with graphic images, you can typically copy and move them too.
-
-
Select what you want to move or copy.
-
Choose Edit from the application's main menu.
-
Choose Cut to move the selection or choose Copy to copy it.
-
Put the insertion point where you want the selection to be displayed.
-
Choose Paste.

Figure 9-9
- Choosing Cut removes the current selection and places it on the pasteboard--your system's holding place for information you are transferring from one place to another. Choosing Copy puts a copy of the selection on the pasteboard.
- The Paste command inserts the contents of the pasteboard at the insertion point, or if you selected text, in place of the selection.
- You can paste text anywhere you can type--somewhere else in a document, in a text field, even in another application. Just click where you want the text to go.
- A selection stays on the pasteboard until you replace it by choosing Cut or Copy again. You can therefore keep choosing Paste to paste the same selection over and over. When you paste a word that you cut or copied after double-clicking on it, spacing is adjusted around the pasted word.
Finding Text
- You can search for a string of text in a document, such as an Edit document or a Mail message you are composing. You do this with the Find panel as shown in Figure 9-10 on page 9-10.
-
-
Choose Edit from the application's main menu.
-
Choose Find from the Edit menu.
-
Choose Find Panel from the Find menu.
-
Click in the document you want to search.
-
In the Find panel, type the text you want to find.
-
Click on the Next or Previous button.

Figure 9-10
- You can search for any sequence of characters in the standard text character set, including spaces. In some applications, you can also search for characters such as tabs and returns.
- The Find panels in Edit and Mail have the options listed in Table 9-1 for searching for text.
-
Table 9-1
| Option | Meaning |
| Ignore Case | Uncheck the Ignore Case box to distinguish between uppercase and lowercase letters during the search--for example, to locate "Planet" but not "planet". |
| Regular Expression | Check this box if you want the Find panel to recognize UNIX regular expressions, which are described in the UNIX manual page for ed. |
- Commands in the Find menu provide other ways to search for text. See "Standard Commands" on page A-1.
Replacing Text That You Find
- In some applications, including Edit and Mail, the Find panel (see Figure 9-11) provides easy ways to replace each occurrence of text you find with another string of text. You can replace occurrences one by one, or you can replace them all at once.
-
-
Choose Edit from the application's main menu.
-
Choose Find from the Edit menu.
-
Choose Find Panel from the Find menu.
-
Click in the document you want to search.
-
In the Find panel, type the text you want to find and the replacement text.
-
Click on the Next or Previous button.
-
Click on a replace button.

Figure 9-11
-
Note - You can delete one or more occurrences of text you are searching for by leaving the "Replace with" field empty and clicking on a replace button.
- The Find panel in Edit and Mail has several options (see Table 9-2) for replacing text you find. In Mail, these options apply only for a message you are composing.
-
Table 9-2
| Option | Meaning |
| Replace | Click on this button after finding an occurrence of text to replace it with the text in the "Replace with" field. |
| Replace & Find | Click on this button to replace the current occurrence and find the next one, all in one motion. |
| Replace All | You can use the Replace All button to replace all occurrences of the text you are searching for. Replace All can apply to the entire document or to a selection only, depending on the setting under Replace All Scope. |
| Entire File | If you set the Entire File option under Replace All Scope,
Replace All replaces all occurrences in the document. |
| Selection | You can select a portion of a document and set Selection under Replace All Scope. Clicking on Replace All then replaces only the occurrences in the selection. |
Setting a New Font
- You can give text in a document a different look by setting its font--changing its font family, making it bold, making it larger or smaller, or combining these effects. You use the Font Panel, as shown in Figure 9-12 and Figure 9-13 on page 9-13. The new font you select on the panel applies to text you are about to type at the insertion point or to text you select.
-
-
Select the text whose font you want to change, or click where you want to type text in a new font.
-
Choose Format from the application's main menu.
-
Choose Font from the Format menu.
-
Choose Font Panel from the Font menu.
-
In the Font Panel, select the font family, typeface, and size you want.
-
Click on Set.

Figure 9-12

Figure 9-13
- You can double-click on a font property to set it without clicking on Set. For example, double-click on 12 in the Size column to make your selection 12 points.
- The top of the Font Panel usually displays the current font--the one you are about to type at the insertion point or the font of text you select (see Figure 9-14 on page 9-14).

Figure 9-14
- You can apply one font property to a selection without affecting other properties. For example, you might select the following text:
Third Annual Blue Planet We are the Earth
- This selection includes more than one size and typeface. If you reset its size to 11 points, the whole selection is displayed in 11-point but the typefaces stay the same:
-
Third Annual Blue Planet
-
We are the Earth
- If you set a family but not a typeface, for example, by double-clicking on the family in the Font Panel, a matching typeface in the new family is set automatically. Changing the above example to Helvetica, for example, makes it look like this:
-
Third Annual Blue Planet
-
We are the Earth
- If a matching typeface is not available, setting the family but not a typeface has no effect.
- You can also set font properties by choosing commands such as Bold or Italic from the Font menu. See "Standard Commands" on page A-1.
- In some applications, the Font command is in the main menu. See the user's guide for the application.
- See also "What Is a Font?" on page 9-15.
Fonts and Special Characters
- When you work with symbols and graphic characters that are not standard text characters, you can change the font family of standard characters in a selection without affecting the other characters. Just do not set a typeface.
- For example, if you select "(C) Blue Planet," which is in the Helvetica font family, and then double-click on Times(R) in the Font Panel, the standard characters change to Times and the (C) remains, as in "(C) Blue Planet." If you similarly change "The value .r2" from Helvetica to Times, the standard characters assume the new font but the . remains. If you instead set a typeface in either of these examples, the (C) or . changes to its equivalent standard character--here, a c or a p.
- Some special characters, including ., are actually members of another font family. See "What Is a Font?.
What Is a Font?
- A font is a set of properties--font family, typeface, and size--that determine what text looks like.
- A font family is a collection of characters with a consistent design. Most families contain standard text characters. Some families, however, have symbols or graphic characters. The Symbol family, for example, has letters from the Greek alphabet and mathematical symbols.
- Unlike other families, the characters in the Courier family all have the same width.
- A typeface is a variation of a font family, such as Bold, Italic, or Bold Italic. Each family has its own set of typefaces.
- The size of text is measured in points: A point is 1/72 of an inch. Point size is relative within a font family, so 11-point Times is larger than 10-point Times but looks smaller than 11-point Helvetica.
- All characters--even spaces--have a font. If you put the insertion point after the space between two words and start to type, the text is displayed in the same font as the space character (which may not be the font of any neighboring text character).
- The fonts available for your use will depend on the network you are using, but the fonts listed in Table 9-3 should be available in most situations.
-
Table 9-3
| Font Family | Example |
| Lucida Sans | This family is used on the OpenStep windows, and is usually the default font for Edit, Mail and other documents. |
| Times | This family is popular for memos, letters, or other documents. |
| Helvetica | This family is often used for headlines or headings. |
| Symbol | . . . . (C) (TM) . . (R) |
| Courier | This is a standard typewriter family. |
Previewing a Font
- You can see what a font looks like before you actually apply it to your document, as shown in Figure 9-15 on page 9-17.
-
-
Choose Format from the application's main menu.
-
Choose Font from the Format menu.
-
Choose Font Panel from the Font menu.
-
In the Font Panel, select the font you want to preview and click on Preview.
-
Replace text at the top of the panel with text you want to preview.
-
Delete text you typed to display font names at the top of the panel again.

Figure 9-15
- If you hold down the Shift key while clicking on the Preview button, the button remains highlighted until you Shift-click on it again. While the button is highlighted, each selection you make in the Font Panel is previewed at the top of the panel.
Setting Margins, Indentation, and Tabs
- In many applications, you can use a ruler to alter margins, tab stops, and indentation (see Figure 9-16 through Figure 9-20). The ruler is initially hidden, but you can display it in a document window with the Show Ruler command.
-
-
Choose Format from the application's main menu.
-
Choose Text from the Format menu.
-
Choose Show Ruler from the Text menu.
-
Drag the left and right margin markers to set the margins for the entire document.
-
Adjust tab and indentation markers to format individual paragraphs.

Figure 9-16

Figure 9-17
Margin Markers
-

- The margin markers set the left and right margins of all text in the
- document (see Figure 9-18).

Figure 9-18
Tab Stop Markers
- To change the tab stops in a paragraph, click or select text anywhere in the paragraph. Then adjust tab markers in one of the ways shown in Figure 9-19.

Figure 9-19
- Once you adjust the markers, you can press the Tab key anywhere in the paragraph and the insertion point advances to the next tab position.
Indentation Markers
-

- Indentation markers also apply to the paragraph where you click or make a selection. Drag the first line indentation marker ( ) to indent the first line of the paragraph. Drag the body indentation marker (·) to indent the rest of the lines of the paragraph.
- When you press Return to start a new paragraph, the new paragraph has the same indentation and tab stops as the one preceding it. You can also select several paragraphs to format all at once.
-
Note - If you drag the first line marker to the left of the body indent marker you can create a hanging indent. If you then align the body indentation marker with a tab marker, you can type a bulleted paragraph, like the one in Figure 9-20.

Figure 9-20
- You can also use commands in the Text menu to align text in a paragraph and to copy and paste ruler settings. See "Standard Commands" on page A-1.
- The location of the Text command may vary for some OpenStep applications. For specific information, see the chapter that describes the application.
Checking Your Spelling
- In some applications, including Edit and Mail, you can quickly locate misspelled words and choose from possible corrections, as shown in Figure 9-21 on page 9-22.
-
-
Click in the document you want to check.
-
Choose Edit from the application's main menu.
-
Choose Spelling from the Edit menu.
-
Click on Find Next in the Spelling panel.
-
When a misspelled word is found, correct it or select another option from the panel.
-
Repeat steps 4 and 5 until you have checked the entire document.

Figure 9-21
- If a word appears to be misspelled, but is actually correct for the document you are checking, click on Ignore. For this document only, the panel skips all other occurrences of the word.
- You can double-click on a word listed in the guess section of the panel to correct the misspelled word in your document. Then you do not have to click on Correct.
- You can choose Check Spelling from the Edit menu to check spelling without opening the Spelling panel. See "Standard Commands" on page A-1.
- You can even check the spelling of a word that is not in the document you are checking so that you can determine the correct spelling before you type it, as shown in Figure 9-22.

Figure 9-22
Dictionary Options
- The Spelling panel checks spelling against an English spelling dictionary. It also provides options for selecting from other dictionaries you have installed or for modifying a dictionary.
-
Dictionary If you have installed additional dictionaries, you can press this button to choose the one you want to use. The panel checks spelling against words listed in the dictionary you choose.
-
Learn If the panel identifies a correctly spelled word as misspelled, you can click on Learn to add the word to the current dictionary. The panel then treats this word as correct when you use any dictionary of the same language.
-
Forget You can select a word you have added to the current dictionary and click on Forget to remove the word from the dictionary.
-
Ignore Click on this button to treat all occurrences of a word as correct for this document only, without adding the word to the dictionary.
- For information on installing additional dictionaries, such as a French or German dictionary, see the instructions that come with the dictionary.
|
|