Re: manage documentEdited
Re: manage documentEdited
- Subject: Re: manage documentEdited
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 9 Apr 2002 23:14:16 +0200
on 02-04-08 3:32 PM, Gerriet M. Denkmann at email@hidden wrote:
I have a document based application, which uses the build-in undo.
The problem is that there are (beside real changes: which change the
data) also non-real changes, which change the look of the document and
which are part of the undo mechanism, but which do not change the data.
I would like to have the window not show the document-edited flag if
only non-real changes have taken place.
I've had good luck by tracking these notifications:
NSUndoManagerWillCloseUndoGroupNotification,
NSUndoManagerDidUndoChangeNotification, and
NSUndoManagerDidRedoChangeNotification. In response to each I invoke the
appropriate method to reverse the undo manager's incrementing or
decrementing the change counter when the user chose undo or redo. The
standard method and constants for doing this are
updateChangeCount:NSChangeUndone, updateChangeCount:NSChangeDone, and
updateChangeCount:NSChangeClear (I'm working from memory on that last
one).
All this is very tricky. It requires careful tracking and counting of
changes, and you have to take into account both undos and redos.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
Thanks a lot, works perfect for me!
Gerriet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.