Basic Mathematical Editing

This section helps you understand how to use standard editing operations in the context of editing mathematical expressions in Zed, including the File menu, the Edit menu, support for cut and paste operations, and drag and drop support.


Basic Editing Example
The File Menu
The Edit Menu
Undo and Redo
Cut and Paste
Drag and Drop

This section gives a brief overview of how the standard conventions for interacting with Windows applications are used in Zed to manage the editing of mathematical expressions. Since you will probably find many of these concepts familiar from using other applications, the following paragraphs attempt to focus on differences arising from the nature of editing mathematical expressions.


Basic Editing Example

The file Example/double.html can be used to illustrate many of the standard file handling operations. It consists merely of two instances of the Zed component on a web page. While the file itself is not very interesting, clicking on the above link will bring up the file in its own window to provide you with a convenient sandbox for trying out the various menu items as you read the following paragraphs.


The File Menu

The File menu contains the standard file handling commands for creating, opening, saving, printing, and closing files. While the printing commands are present on the menu, they are disabled as not yet supported in this version of Zed. The File menu also maintains a list of the last few files you've recently opened, as is standard in many applications.

The File Open dialog used by a number of the commands on the File menu allows you to list files of type .mml (MathML Files) or files of type .zed (Zed Files).

In the component edition, the File menu is available on the context menu. A file can be opened in a particular instance of the component using the context menu, allowing that instance to load and save its data to and from the associated file. Closing a file in an instance of the component removes its association with a file, and removes the expression being edited in the instance. Creating a new file in the component, using the File→New command, essentially does the same thing.

Each of the operations on the File menu is described separately in the Menus section of the Reference part of this Users Guide.


The Edit Menu

The Edit menu provides those standard operations that provide cut and paste and undo and redo support, as well as an option for editing the underlying source for the document.

The Edit→Source menu item raises a dialog that allows the user to modify the MathML source for the current expression being edited, as described in the Editing the Markup paragraphs in the Basic Viewing section.

The undo and redo commands allow you to return to any previous state of the editor, as described below.

The cut and paste commands provide standard clipboard support, and are also described below.

Each of the operations on the Edit menu is described separately in the Menus section of the Reference part of this Users Guide.


Undo and Redo

The Edit→Undo and Edit→Redo menu items allow you to navigate an infinite stack of previous states of the current document. The undo operation moves the state of the editor backward in time, and the redo operation moves the state of the editor forward in time. If you use the undo operation to return to a previous state and then make additional changes, you also have the ability to undo the undo operations and still recover any previous state. The state of the editor includes the content markup for the expression being edited, as well as the location of the expression cursor. The undo/redo stack is often easier to navigate by using the keyboard equivalents of these commands, Ctrl+Z for undo, and Ctrl+Shift+Z for redo. These commands are also available on the Standard toolbar.


Cut and Paste

Access to the standard cut and paste operations is provided by the corresponding menu items on the Edit menu, and by a set of buttons on the Standard toolbar. Zed participates in cut and paste operations on the document file types it supports, and on well-formed content expressions, as delimited by the current expression.

In addition to the standard operations (cut for removing the current expression to the clipboard, copy for copying the current expression to the clipboard, and paste for copying the current expression from the clipboard) Zed provides a delete operation for removing the current expression while preserving the state of the clipboard.

Zed reads and writes the text and HTML clipboard formats. If both are present on the clipboard, Zed will try to read the HTML format to see if it can extract the MathML, otherwise, it will fall back on the text format and try to parse it as MathML.


Drag and Drop

Access to the standard drag and drop operations is provided in the usual way using the mouse. Zed participates in drag and drop operations on the document file types it supports, and on well-formed content expressions, as delimited by the current expression.

From inside Zed, a drag operation is initiated by clicking and holding the left mouse button inside the extent of the current expression as delimited by the expression cursor, and then moving the mouse outside the extent of the current expression. The mouse cursor then changes to an icon indicating whether or not the expression may be dropped at the current point.

When an expression is dropped on a Zed window, the expression being dropped replaces the current expression just as for a paste operation. Since the expression being dragged is also the current expression in the source document, Zed disallows dropping onto the source document for the expression being dragged, as the operation would have no effect in any case.

In addition to dropping an expression on a Zed window, you can also drop files from the filesystem into the editor; this operation is identical to the operation of opening the files. In the application edition, each file is opened in its own window, and in the component edition, one file is opened in the instance dropped upon.

More information about the drag and drop operations, the events that invoke them, and their interaction with other Mouse Actions can be found in the Events section of the Reference part of this Users Guide.