Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!uwvax!husc6!necntc!mit-eddie!ll-xn!cit-vax!tybalt.caltech.edu!wetter From: wetter@tybalt.caltech.edu.UUCP Newsgroups: comp.sys.mac Subject: Re: MacApp's undo ability. Message-ID: <1999@cit-vax.Caltech.Edu> Date: Wed, 11-Mar-87 01:20:32 EST Article-I.D.: cit-vax.1999 Posted: Wed Mar 11 01:20:32 1987 Date-Received: Wed, 11-Mar-87 20:34:30 EST References: <7932@watlion.UUCP> Sender: news@cit-vax.Caltech.Edu Reply-To: wetter@tybalt.caltech.edu.UUCP (Pierce T. Wetter) Distribution: comp Organization: Calfornia Institute of Technology Lines: 47 In article <7932@watlion.UUCP> pgtrubey@watlion.UUCP writes: >Somebody a while back mentioned something about extending MacApp >to allow for multiple undo operations as opposed to just being >able to undo the latest command. > > >It seems to me that it wouldn't be too hard given the current MacApp >framework. Instead of MacApp ing the last command before >ing the current one, why couldn't it keep all the commands >on a stack and thus it could successively undo each operation. >I guess as you undid commands, you would have to keep another stack >to be able to redo each command. Another way to do this would be two have another method "Uncommit". This method would perform an undo for a command already commited. This also requires that there be an undo data stack to handle the data the command needs to uncommit. This is assuming the command is freed after it is committed. The alternative is to have a lot of command objects sitting in your heap (yech).> >The only problem that I see is when to the commands. You could >either allow a maximum undo stack, or you could commit commands only when >something like a file save was being performed. A rational limit for a command stack would be from 2-4 (>4 might cause innumerable side effects between undos. if you undo a change to a deleted object do you undo the delete too?). Also needed would be another menu command. Undo # since undo toggles between undo and redo. What about if the user only wants to undo one of the commands on the stack? Should there be four commands undo "commandname" X 4? I'm not sure this is worth the trouble. Good luck. Pierce Wetter. Magnet, n.: Something acted upon by magnetism Magnetism, n.: Something acting upon a magnet. The two definition immediately foregoing are condensed from the works of one thousand eminent scientists, who have illuminated the subject with a great white light, to the inexpressible advancement of human knowledge. -- Ambrose Bierce, "The Devil's Dictionary" -------------------------------------------- wetter@tybalt.caltech.edu --------------------------------------------