Next: 2.6 Viewing Documents
Up: 2 Document Editing
Previous: 2.4 Loading and Saving
Subsections
There are two types of document edit commands: commands that are
issued by the mouse, when the mouse pointer is in the drawing area, and the
commands listed in the Edit menu. All diagram and tree editors
share the same set of edit commands (chapter 3).
All table editors too share the same set of edit commands
(chapter 7). However, the edit commands of diagram
and tree editors on one hand and table editors differ to a large extent.
All document edit commands, except the simple selection commands and
the key-stroke text edit commands are undo-able and redo-able (multiple levels).
All editors have certain commands to select items, to move and
resize items, to edit the text of items, to add items and to
delete items. Only the text edit commands are very similar across
all editors and therefore they are described in this chapter.
For the other commands you are referred to chapter 3
(diagrams and trees) and chapter 7 (tables).
In order to be able to type in a label of a shape in a diagram or
the text in a table cell, the shape or cell should be the only currently
selected shape or cell. For going into edit mode you can do the following.
Move the mouse pointer into the single selected shape or cell,
and when the mouse pointer has turned into a
,you can start editing by typing characters or by clicking button-1 again.
In both cases the edit mode starts.
There are two edit modes: in-line editing and out-line editing.
In-line editing takes place directly in the drawing area and during in-line
editing a black triangle shaped cursor is visible. Out-line editing takes place in
a separate window with a text editor that is popped up when the edit mode
is entered. That window contains an editable Motif text entry area,
a menu bar, scroll bars and two buttons: OK and Cancel.
You can indicate which of the two possible edit modes has to be used
by a toggle button labeled in-line editor. That toggle is near
the bottom of the main window and it is also accessible via the View menu.
In general, in-line editing is more suitable for quickly editing
short labels, whereas out-line editing has scroll bars and some extra
edit operations and is more suitable for editing large chunks of texts.
With out-line editing it is also possible to cut and paste text
within and between text edit windows.
Here we summarize all operations that are available in the
in-line editor.
Text edit dialogs are almost complete text editors, see figure 2.5.
Text edit dialogs are not only used for out-line editing text labels
but also for editing document and subject annotations. The operations in
the dialog are
mostly standard Motif operations. Here we will summarize the most important
ones:
Figure 2.5:
TCM text edit dialog.
![\begin{figure}
\begin{center}
\includegraphics [width=5.5in]{p/texteditdialog.ps}\end{center}\end{figure}](img9.gif) |
- Start editing. When you have popped up the text edit dialog
and the text area has the input focus then you can start editing.
A blinking I-beam insertion cursor indicates where text will be inserted.
- Stop editing. You leave the edit session by clicking
the OK button. The dialog is dismissed and the text (a shape label,
an annotation, a cell text etc.) will be updated.
When the autoresize toggle is on, the shape or cell will
also be resized to make it fit the entire text.
When the text editor is used for out-line editing, you can undo the
update after you have clicked the OK button.
- Cancel editing. You cancel with the Cancel button.
When you have canceled, the dialog is dismissed and the text that was being
edited will not be updated. The modifications that you have made
in the window are lost.
- Add character after the cursor.
Type in the character. Labels may contain all printable ASCII characters,
except the <Tab>.
- Delete character after the cursor.
Use the <Delete> key.
- Delete character before the cursor.
Use the <BackSpace> key.
- Move cursor left.
Use the <ArrowLeft> key to move the cursor one character left.
- Move cursor right.
Use the <ArrowRight> key.
- Move cursor one line up.
Use the <ArrowUp> key.
- Move cursor one line down.
Use the <ArrowDown> key.
- Move cursor one page up.
Use the <PageUp> key.
- Move cursor one page down.
Use the <PageDown> key.
- Delete all (<Ctrl+D>).
Use the Delete All command in the edit menu or press <Ctrl+D> in the
text edit dialog
.
- Move cursor to beginning of line.
<Home> moves the cursor in front of the first character of the current line.
- Move cursor to end of line.
<End> moves the cursor after the last character of the current line.
- Directly position the cursor.
You can click with button-1 on the desired cursor position.
If you want to change the cursor position without changing the
selection, press <Ctrl> while you click button-1.
- Select text.
You can select a part of the text by dragging with button-1 over the
region that you want to select; or when you click button-1 twice in a word
then the word is selected; or when you click thrice, the line is
selected; or when you click four times, the entire text
is selected. Selected text is highlighted in reverse video.
- Clear selection.
Click button1 anywhere outside the selected region.
- Copy (<Ctrl+C>).
Copy the selected text into the Motif clipboard.
Motif has built-in a clipboard which acts like a
cut-paste buffer for copying and moving text between text areas
of the same or different Motif applications.
- Cut (<Ctrl+X>).
Cut the selected text into the Motif clipboard.
This is like Copy but Cut deletes the selected portion
after copying it to the clipboard. Note that before you can cut
or copy, you have to select some text.
- Paste (<Ctrl+Y>).
Pastes the contents of the Motif clipboard into the text edit area.
The text is inserted at the current cursor position.
- Find (<Ctrl+F>).
This command pops up a prompt dialog (figure 2.6) for finding a text string
in the text edit area. The find text dialog has an input field to type
the text that you are looking for and it has a check button and four push
buttons that mean the following:
- case sensitive. This check button says that the case of the string to
find is significant. By default, Find (and Replace) are case insensitive.
- Find Next. Finds the next string that matches the string to find.
The insertion cursor of the edit area is put in front of the string that
is found and the scroll bars are adjusted if needed.
- Find All. Highlights all strings that matches the string
to find and the dialog says how many occurrences are found.
- Dismiss. Closes the dialog.
- Clear. Clears the text entry field for the string to find.
- Replace (<Ctrl+Z>).
This command pops up a prompt dialog (figure 2.7) for finding
and replacing text strings
in the text edit area. The replace text dialog has two input fields, one to type
the text that you are looking for and one to type the text that you want as
a replacement. The replace dialog has a check button and five push
buttons that mean the following:
- case sensitive. Same as in the Find dialog.
- Find Next. Same as in the Find dialog.
- Replace Next. The next string found after the insertion cursor is
replaced by the string to replace with. Before you do a Replace Next,
you can do a Find Next so that you see which string you replace.
Also note that the string to find should not be empty, but the
replacement string may be empty.
- Replace All. All strings that match the string to find are replaced
by the string to replace with (global substitution).
- Dismiss. Closes the dialog.
- Clear. Clears both text entry fields.
In the diagram and table editors the find dialog and the replace dialog
are also used for finding and replacing text in the entire diagram
or table. These operations are issued from the Find and Replace entries
in the Text menu of the main window (see section 2.11).
- Load (<Ctrl+L>).
This command shows a file selection dialog by means of which you
can select an arbitrary text file. When you press OK, the contents
of the file is loaded into the text editor. You can load any text
file of any size.
- Save as (<Ctrl+S>).
This command shows a file selection dialog for saving the contents of
the text editor to a file.
- Print (<Ctrl+P>).
This command directly sends the contents of the text editor to
the current printer. The text is first converted to PostScript and it
receives a header. At the moment it is only possible to directly
print text with the Print of this dialog in Helvetica font and
with point size 9. If you want the text printed differently, you
have to save it first to a file and then post-process it yourself for
instance with the program text2ps that is supplied together
with TCM (see man text2ps).
Figure 2.6:
TCM find dialog.
![\begin{figure}
\begin{center}
\includegraphics [width=3in]{p/finddialog.ps}\end{center}\end{figure}](img10.gif) |
Figure 2.7:
TCM replace dialog.
![\begin{figure}
\begin{center}
\includegraphics [width=3.75in]{p/replacedialog.ps}\end{center}\end{figure}](img11.gif) |
Next: 2.6 Viewing Documents
Up: 2 Document Editing
Previous: 2.4 Loading and Saving
Frank Dehne,Faculty of Mathematics and Computer Science, Vrije Universiteit Amsterdam
11/17/1997