Multiple undo and redo

Ben Fisher jamon.ben at gmail.com
Sun Feb 18 17:54:01 EST 2007


As far as the form designer goes: I understand that this is not
trivial. I assume that your point is that anything done from, say the
message box, would be hard to keep track of and undo. True.
It would be reasonable if basic IDE actions could be undone. Other
form designers can accomplish this.
( Right now it appears that moving an object can be undone, and
typing, but little else. The menu is not grayed out, but selecting it
does nothing. )

Reasonable undo capabilities:
I refer to a stack, meaning LIFO data structure.
Create a stack in memory called data_undo.

When a basic action is performed, say the user selects a button and
presses Delete, the following could happen:

- If the stack is too big, say 10 elements, get rid of the oldest element.
- An action saying "Delete" and the button data is pushed into
data_undo, in whatever internal representation of a button is used.

The user now selects a new item. No action is recorded, because this
action is ignored.

The user types in something in the message box and presses enter. No
action is recorded, because this type of action is too hard to keep
track of and could have multiple effects.

The user switches tools. No action is recorded. (The way Revolution is
now, switching tools clears the Undo.)

The user begins editing a lengthy and complicated group script. While
in the script editor, undo and redo are handled by the script editor.

The user presses Ctrl+G, thinking that this will be the shortcut for
Go to Line. Instead, the message is passed to the IDE which ungroups
the selected objects, effectively deleting the group script and
properties without warning. The user is still able to undo this
Ungroup command by using Undo.

In the script editor: there is no good reason. I have written undo for
small scale text editors, simply by remembering the last 10 states. It
is not like this is storing images in memory or something.

-Ben


--Have you ever implemented Undo for a scripted application?

-- 
 -- Richard Gaskin Managing Editor, revJournal
--  _______________________________________________________
--  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list