On Feb 10, 2012, at 15:03 , Mike Abdullah wrote:
> My line of thinking:
>
> Each time one of your undo managers is about to close its top-level group,
> register that with the doc's main undo manager. Thus the doc's undo manager
> will see the change while locked, prompt the user to unlock, and if they do
> choose to cancel, will undo the change to individual undo manager. Something
> like:
>
> - (void)undoManagerWillCloseGroup:(NSNotification *)notification
> {
> NSUndoManager *manager = [notification object];
> if ([manager groupingLevel] == 1)
> {
> [[[self document] undoManager] registerUndoWithTarget:manager
> selector:@selector(undo) object:nil];
> }
> }
Won't this have the effect of causing successive undos to affect various pages,
according to the order things were originally done, rather than just undoing
within the current "page"? That is, won't it undo on a global "timeline" rather
than a per-page timeline?
I don't recall that this was discussed, but what happens if the document's undo
manager is changed to the page undo manager every time page switch occurs? I
can't work out if the OP tried this and found that the document's "edited"
status doesn't capture the undo manager states properly, or if the OP didn't
try this.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]