next up previous contents index
Next: Text Editor Key Bindings Up: The WRspice User Interface Previous: The File Manager   Contents   Index


The Text Editor

WRspice provides a general-purpose text editor window. It is used for editing text files or blocks, and may be invoked in read-only mode for use as a file viewer. In that mode, commands which modify the text are not available.

The following commands are found in the File menu of the editor. Not all of these commands may be available, for example the Open button is absent when editing text blocks.

Open
Bring up the File Selection panel. This may be used to select a file to load into the editor. This is the same file manager available from the Open button in the File menu of the Tool Control Window.

Load
Bring up a dialog which solicits the name of a file to edit. If the current document is modified and not saved, a warning will be issued, and the file will not be loaded. Pressing Load a second time will load the new file, discarding the current document.

Read
Bring up a dialog which solicits the name of a file whose text is to be inserted into the document at the cursor position.

Save
Save the document to disk, or back to the application if editing a text block under the control of some command.

Save As
Pop up a dialog which solicits a new file name to save the current document under. If there is selected text, the selected text will be saved, not the entire document.

Print
Bring up a pop-up which enables the document to be printed to a printer, or saved to a file.

Write CRLF
This menu item appears only in the Windows versions. It controls the line termination format used in files written by the text editor. The default is to use the archaic Windows two-byte (DOS) termination. If this button is unset, the more modern and efficient UNIX-style termination is used. Older Windows programs such as Notepad require two-byte termination. Most newer objects and programs can use either format, as can the XicTools programs.

Quit
Exit the editor. If the document is modified and not saved, a warning is issued, and the editor is not exited. Pressing Quit again will exit the editor without saving.

The editor can also be dismissed with the window manager ``dismiss window'' function, which may be an `X' button in the title bar. This has the same effect as the Quit button.

The editor is sensitive as a drop receiver. If a file is dragged into the editor and dropped, and neither of the Load or Read dialogs is visible, the Load dialog will appear with the name of the dropped file preloaded into the dialog text area. If the drop occurs with the Load dialog visible, the dropped file name will be entered into the Load dialog. Otherwise, if the Read dialog is visible, the text will be inserted into that dialog.

If the Ctrl key is held during the drop, and the text is not read-only, the text will instead be inserted into the document at the insertion point.

The following commands are found in the Edit menu of the text editor.

Undo This will undo the last modification, progressively. The number of operations that can be undone is limited to 25 in Windows, but is unlimited in Unix/Linux.

Redo This will redo previously undone operations, progressively.

The remaining entries allow copying of selected text to and from other windows.

Under Windows there is a single ``Windows clipboard'' which is a system-wide data-transfer register that can accommodate a single data item (usually a string). This can be used to pass data between windows.

Text in many text display windows (including the text editor) can be selected by dragging with button 1 held down, however the selected text is not automatically added to the Windows clipboard. On must initiate a cut or copy operation in the window to actually save the selected text to the Windows clipboard.

Under Unix/Linux, there are two similar data transfer registers: the ``primary selection'', and the ``clipboard''. Both correspond to system-wide registers, which can accommodate one data item (usually a text string) each. When text is selected in any window, usually by dragging over the text with button 1 held down, that text is automatically copied into the primary selection register. The primary selection can be ``pasted'' into other windows that are accepting text entry.

The clipboard, on the other hand, is generally set and used only by the GTK text-entry widgets. This includes the single-line entry used in many places, and the multi-line text window used in the text editor, file browser, and some other places including error reporting and info windows. From these windows, there are key bindings and/or menu items that cut or copy selected text to the clipboard, or paste clipboard text into the window. The cut/paste functions are only available if text in the window is editable, copy is always available.

Note that pressing mouse button 2 will paste the primary selection into to editor window (if the text is editable) at the press location.

Cut to Clipboard
Delete selected text to the clipboard. The accelerator Crtl-X also performs this operation. This function is not available if the text is read-only.

Copy to Clipboard
Copy selected text to the clipboard. The accelerator Ctrl-C also performs this operation. This function is available whether or not the text is read-only.

Paste from Clipboard
Paste the contents of the clipboard into the document at the cursor location. The accelerator Crtl-V also performs this operation. This function is not available if the text is read-only.

Paste Primary (Unix/Linux only)
Paste the contents of the primary selection register into the document at the cursor location. The accelerator Alt-P also performs this operation. This function is not available if the text is read-only.

The following commands are found in the Options menu of the editor.

Search
Pop up a dialog which solicits a regular expression to search for in the document. The up and down arrow buttons will perform the search, in the direction of the arrows. If the No Case button is active, case will be ignored in the search. The next matching text in the document will be highlighted. If there is no match, ``not found'' will be displayed in the message area of the pop-up.

The search starts at the current text insertion point (the location of the I-beam cursor). This may not be visible if the text is read-only, but the location can be set by clicking with button 1. The search does not wrap.

Source
Read the content of the editor into WRspice as through the source command. One can also save the file to disk, and use the source command directly.

Font
This brings up a tool for selecting the font to use in the text window. Selecting a font will change the present font, and will set the default font for new text editor class windows. This includes the file browser and mail client pop-ups.



Subsections
next up previous contents index
Next: Text Editor Key Bindings Up: The WRspice User Interface Previous: The File Manager   Contents   Index
Stephen R. Whiteley 2012-09-24