Undo
Encyclopedia
Undo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing
Graphics software
In computer graphics, graphics software or image editing software is a program or collection of programs that enable a person to manipulate visual images on a computer....

, undo will negate the last command done to the file being edited.

The opposite of undo is redo. The redo command reverses the undo or advances the buffer to a more current state.

In most Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 applications, the Undo command is activated by pressing Ctrl+Z
Control-Z
In computing, is a control character in ASCII code, also known as the substitute character or a keyboard shortcut. Strictly speaking, is not a printable character at all but a code for control purposes, though it is sometimes rendered by two characters as ^Z. It is generated by pressing the key...

 or Alt+Backspace. In virtually all Macintosh
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...

 applications, the Undo command is activated by pressing Command
Command key
The Command key, also historically known as the Apple key, open-Apple key or meta key is a modifier key present on Apple Keyboards. The Command key's purpose is to allow the user to enter keyboard shortcut commands to GUI applications...

-Z. The common command for Redo on Microsoft Windows systems is Ctrl+Y
Control-Y
For some Microsoft Windows computer applications, the key combination will redo a previous action that the user chose to undo. usually does not have this meaning in the Apple Macintosh operating system, where often does it....

 or Ctrl
Control key
In computing, a Control key is a modifier key which, when pressed in conjunction with another key, will perform a special operation ; similar to the Shift key, the Control key rarely performs any function when pressed by itself...

+Shift
Shift key
The shift key is a modifier key on a keyboard, used to type capital letters and other alternate "upper" characters. There are typically two shift keys, on the left and right sides of the row below the home row...

+Z. The common command for Redo on Apple Macintosh systems is Command
Command key
The Command key, also historically known as the Apple key, open-Apple key or meta key is a modifier key present on Apple Keyboards. The Command key's purpose is to allow the user to enter keyboard shortcut commands to GUI applications...

-Shift
Shift key
The shift key is a modifier key on a keyboard, used to type capital letters and other alternate "upper" characters. There are typically two shift keys, on the left and right sides of the row below the home row...

-Z.

Command or Control Z is one of the original "sacred" keybindings defined in the first GUI to be widely used, that of the original Macintosh.

History

Behavioral Issues in the Use of Interactive Systems, a 1976 research report by Lance A. Miller and John C. Thomas of IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

, noted that "It would be quite useful to permit users to 'take back' at least the immediately preceding command (by issuing some special 'undo' command)." The programmers at the Xerox PARC research center assigned the keyboard shortcut Ctrl-Z to the undo command, which became a crucial feature of text editors and word processors in the personal computer
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

 era.

Multi-level undo commands were introduced in the 1980s, allowing the users to take back a series of actions, not just the most recent one. AtariWriter
AtariWriter
AtariWriter is a word processing application for the Atari 8-bit computers. It is a 16KB ROM cartridge that works with either a cassette or disk drive.-Details:...

, a word-processing application introduced in 1982, featured undo. NewWord, another word-processing program released by NewStar in 1984, had an unerase command. IBM's VisiWord also had an undelete command.

Undo models

Undo models can be categorized according to two criteria: linear vs non-linear, and single-user vs multi-user. Linear undo requires the user to revert the latest action before undoing earlier ones. With non-linear undo, the action to be reverted can be freely picked from the action history list.

Non-linear undo can be further subcategorized into direct selective undo, script interpretation undo, and cascading undo.

When multiple users can edit the same document simultaneously, a multi-user undo is needed. Global multi-user undo reverts the latest action made to the document, regardless of who performed the edit. Local multi-user undo only reverts actions done by the local user. Local multi-user undo usually requires a non-linear undo implementation.

The number of previous actions that can be undone varies by program. For example, the stack size ranges from twenty in Photoshop to three edits in MS Paint. Simplistic, single-edit undo features sometimes do away with "redo" by treating the undo command itself as an action that can be undone. This is known as the flip undo model, because the user can flip between two program states using the undo command.

Redo models

Redo reverts the effects of the undo action. The simplest form of redo is flip-undo, in which using undo after undoing redoes the undone action. In this case, the program flips back and forth between two states when the undo button is pressed .

In a more typical redo model, there are separate undo and redo buttons. The redo can be used for each undo action performed. Making a new edit usually clears the redo list. If a branching redo model is used, the new edit branches the action history.

Undo implementation

The Command pattern
Command pattern
In object-oriented programming, the command pattern is a design pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later time...

 is a software design pattern
Design pattern (computer science)
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that...

 which can be used to implement Multi-level Undo. The Memento pattern
Memento pattern
The memento pattern is a software design pattern that provides the ability to restore an object to its previous state .The memento pattern is implemented with two objects: the originator and a caretaker. The originator is some object that has an internal state. The caretaker is going to do...

is useful for capturing the state of the program before user actions. This can be used for state reversal needed in some undo implementations.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK