Search Images Maps Play YouTube News Gmail Drive More »
Advanced Patent Search | Page images | Web History | Sign in

Patents

  
[table][merged small][merged small][table][table][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small]
[blocks in formation]
[merged small][merged small][merged small][table][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][merged small][table][merged small][merged small]

1 2

MULTIPLE LEVEL UNDO/REDO FIG. 4b is a diagram illustrating the state of the list of

MECHANISM command element objects after commands are added in the

preferred embodiment of the present invention.

TECHNICAL FIELD piG. 4c diagram illustrating the list of command elements

The present invention relates generally to data processing 5 f ject8 whf a df ti°,n ^" elemenl °n Ust is per"

systems and, more particularly, to a mechanism for provid- formed ln *** Prefeired embodTMent of the present inven

ing a multiple level undo/redo capability in operating sys- tlon"

terns and application programs. FIG. 5a is a flowchart illustrating the steps performed in

an undo operation in the preferred embodiment of the

BACKGROUND OF THE INVENTION 10 present invention.

... .... ~ FIG. 5b is a diagram illustrating a list of command

A single-level undo mechanismas provided by software ... ... whefundo nJs m p^^a m ^

packages, such as the Microsoft Word, version 5.0, word ferred embodiment of the t

processing package, which is sold by Microsoft Corporation r ,.„,.„.,

of Redmond, Washington. The single level undo mechanism 15 TMG- <"* 18 a flowchart ^stia^& *e 8t<;P8 Performed

allows a user command to be undone (i.e., the effects of the when a redo °Peratlon 18 Permed m the preferred embodi

command are reversed) after the command has already been ment of the invention.

performed. The undo command is typically performed by mG- 6b 18 a diagram iUustrating the list of command

selecting a menu item that lists the undo command as an element objects when a redo operation is performed in the

option. The user is limited to a single level of undoing of 20 preferred embodiment of the present invention,

commands and, thus, can only reverse the most recently FIG. 7a is a flowchart illustrating the steps performed

executed command. when an undo "All the Way" operation is performed in the

preferred embodiment of the present invention.

SUMMARY OF THE INVENTION FIG. 7b is a diagram illustrating the Ust of command

Li accordance with a first aspect of the present invention, 25 element °bjef whe£n anJun*> the W" °Peration is

a method is practiced in a data processing system having performed m the preferred embodiment of the present mven

memory means and at least one processor that is responsive tlon'

to user commands. In this method, a log of user commands FIG. 8a is a flowchart illustrating the steps performed

that were executed by the processor is stored in the memory when a redo "All the Way" operation is performed in the

means. A first user command stored in a log is undone so as preferred embodiment of the present invention,

to reverse the effect of the first user command. Subsequently, FIG. 8b is a diagram illustrating the list of command

a next user command stored in the log is undone so as to element objects when a redo "All the Way" operation is

reverse the effect of the next sequential user command. performed in the preferred embodiment of the present inven

In accordance with another aspect of the present 35 tlon

invention, a log of at least two user commands is stored in DETAILED DESCRIPTION OF THE

the memory means. User commands stored in the log are INVENTION undone so as to reverse the effects of at least two user

commands. At least two of the undone user commands are The preferred embodiment of the present invention prothen redone so as to again execute those commands. 40 vides a mechanism for performing multiple-level undo/redo In accordance with a further aspect of the present operations in an application program The mechanism keeps invention, a list of a plurality of user commands is stored in »to8 of user commands and maintains a current position in the memory means in a sequence ranging from a selected the logt0 momtor a current state of 46 application program user command that has been executed by a processor to a 111(5 lo818 used bv *•* mechanism to facilitate multiple-level most recently executed user command. The effects of all of 45 undo °Perations and multiple-level redo operations, the user commands stored in a sequence of the list are FIG. 1 shows a block diagram of a data processing system undone so as to return the processor to reverse the effects of 10 suitable for implementing the preferred embodiment of the user commands in the sequence. me present invention. The data processing system 10

In accordance with still another aspect of the present TMludes a central PTM^ "'.(CPU) 12 and a mff ^

invention, a Ust of a plurality of user commands is stored in so " The memory 14 holds^application programs 22, an

the memory means. The Ust includes user commands that gating system 24 and other items The data processing

have been undone. The user commands that have been system 10 also includes a keyboard 16, a mouse 18 and a

undone are again executed by the processor. Y Processing system 10 shown in

FIG. 1 is a conventional single processor system.

BRIEF DESCRIPTION OF THE DRAWINGS 55 Nevertheless, it should be appreciated that the present invention may also be implemented in a distributed system or in

FIG. 1 is a block diagram of a data processing system for other environments

practicing a preferred embodiment of the present invention. ^ preferred embodiment of the present invention is

FIG. 2 is a block diagram illustrating a command element designed for use in an object-oriented programming envi

object that is used in the preferred embodiment of the ^ ronment For purposes ofthe discussion below, it is assumed

present invention. that the operating system 24 is an object-oriented operating

FIGS. 3a, 3b and 3c Ulustrate elements of a user interface system Those skiUed in the art wiU appreciate, however,

for implementing the multiple-level undo/redo mechanism that the present invention is not limited to use within an

of the preferred embodiment of the present invention. object-oriented operating system Instead, it may also be

FIG. 4a is a flowchart illustrating the steps performed 65 implemented in other environments,

when a user enters a command in the preferred embodiment The object-oriented operating system 24 supports the use

of the present invention. of "objects" in the data processing system 10. An object may 3 4

be viewed as a combination of data members and. member 55 is provided for the undo button 51 when activated (see

functions. The data members are attributes that are stored in FIG. 3b). A similar context menu 57 (FIG. 3c) is provided

data structures, and the member functions are functions that for the redo button. The context menus 55 (FIG. 3b) and 57

act upon these attributes. The notion of an object is exploited (FIG. 3c) provide two options: "Last Applied" and "All The

in the multiple-level undo/redo mechanism of the preferred 5 Way." These options cause either only a single last applied

embodiment of the present invention in that certain aspects command to be undone/redone or the commands to be

of this mechanism are implemented as objects. undone/redone.

An interface is a group of semantically-related functions The four operations provided by the multiple-level undo/

that are organized into a named unit. Each interface may be redo mechanism of the preferred embodiment of the present

uniquely identified by its identifier. Interfaces have no 10 invention are perhaps best explained by way of example. As

instantiation, that is an interface definition does not include such, examples will be provided below along with the steps

code for implementing the functions that are specified in the performed by the preferred embodiment for each of the

interface. Interfaces specify a set of signatures for functions. respective four operation types.

An object may "support" an interface. When an object piG. 4a is a flowchart illustrating the steps performed by

supports an interface, the object provides code for the 15 the preferred embodiment of the present invention when a

function specified by the interface. The code supplied by the user enters a new command. FIG. 4a will be described in

object, however, must comply with the signatures specified conjunction with the diagram of FIG. 4b. FIG. 4b depicts an

by the interface. example of the list 30 of command element objects. Initially,

The multiple-level undo/redo mechanism of the preferred a user enters a command (step 52 in FIG. 4a). In the example

embodiment of the present invention supports the ability for 20 of FIG. 4b, the list 30 is initially empty. Suppose that the

an application program to maintain a command log of user user then enters command "a". The multiple level undo/redo

commands. The data held in the command log and functions mechanism of the preferred embodiment then checks

for maintaining the data are encapsulated into a command whether there are any commands on the list before the cursor

log object. The command log object includes a list 30 (see 32 (step 54 in FIG. 4a). If there are no commands on the list

FIG. 4b) of command element objects and a cursor 32. The 25 before the cursor 32, such as in the case shown in FIG. 4b,

list 30 of command element objects is a sequential list of the command is added to the front of the list 30 (step 58 in

command element objects specifying user commands. The FIG. 4a), and the cursor is moved to point to the front of the

cursor 32 specifies a current position that corresponds with list (step 60). Thus, as shown in FIG. 4b, after command "a"

the last applied (i.e., last executed) command on the list 30 is entered, an entry 64 (i.e., an entry for a command element

of command element objects. 30 object for command "a") is added to the front of the list 30

Each command entered by a user during the course of and the cursor 32 is moved to point to entry 64. Suppose that

execution of an application program 24 generates an assc- the user now enters another command "b", (hence, repeating

dated command element object 40, like that shown in FIG. steP 52 of HG. 4a). Steps 54,58 and 60 of FIG. 4a are then

2. The command element object 40 includes a field 44 that „ repeated so that an entry 66 (FIG. 4b) is added to the front

specifies the nature of the command and a V-pointer 42. The of the list 30 before the entry 64 for command "a". Cursor

V-pointer 42 points to a V-table 46 (i.e., having a virtual 32 is updated to point to entry 66 for command "b".

table such as found in the C++ programming language) In the above-described fashion, the list 30 of command

having entries for the operations that may be performed on element objects is built. In terms of the object model

the command element object 40. These operations include 4Q described above, each time a user enters a command, an

an undo operation, a redo operation and a merge operation, instance of a command element object 40 (FIG. 2) is created;

for which respective entries 48a, 4Sb and 48c are provided. the new command element object is appended to the front of

Entries 48a, 48i> and 48c point to sections of code 50a, 506 the list; and the cursor position is updated,

and 50c for implementing their associated operations. The jf m step 54 0f FIG. 4a it is determined that there are

undo operation undoes the command at the current cursor 45 commands on the list 30 that are situated before the cursor

position. The redo operation performs the next operation on 32, all the commands on the list that are before the cursor are

the list 30 (FIG. 4b). The merge operation merges command deleted (step 56 in FIG. 4a). FIG. 4c shows an example of

log element objects, if possible. sucn a deletion. Suppose that initially list 30 of command

The command log object does not need to know about the log elements includes entries 68, 70 and 72 for commands

implementation of the code 50a, 50b and 50c for imple- 50 "a", "b" and "c", respectively, as shown in FIG. 4c. The

menting operations on the command element objects 40. The cursor 32 points to entry 70 for command "b". Subsequently,

details of this code 50a, 50i> and 50c are the concern of the a user enters command "d". In step 54 of FIG. 4a, it is

command element objects 40. As such, the command log determined that entry 72 for command "c" is positioned

object can be implemented more easily since it does not need before the cursor on list 30. Hence, entry 72 is deleted in step

to concern itself with such details. 55 56 of FIG. 4a. Further, an entry 73 for command "d" is

The command log object and the command element added to the front of the list 30 (see step 58 in FIG. 4a), and

object 40 are created by the application program 22 (FIG. 1). the cursor 32 (FIG. 4c) is updated to point to entry 73 (see

The operating system 24 provides a multi-level undo/redo steP 60 in FIG. 4a).

facility to support multiple undo/redo operations for the Once a user has built a list 30 of command element

application program. Part of this mechanism is a user 60 objects, such as described above, the user may execute an

interface. The user interface displays buttons 51 and 53 undo command. FIG. 5a is a flowchart of the steps per

(FIG. 3a) that may be activated to cause execution of undo formed when an undo command is requested. FIG. 5b is a

and redo commands, respectively. The undo button 51 and diagram illustrating the state of the list 30 of command

the redo button 53 may be activated multiple times to element objects after multiple undo commands are per

perform multiple undos or redos consecutively. The user is 65 formed on the list. The steps of FIG. 5a will be described in

not limited to undoing only a most recent command or conjunction with the diagram of FIG. 5b. Initially, a user

redoing a most recently undone command. A context menu requests an undo operation by activating the undo button 51

« PreviousContinue »