Re: multiple UndoManagers
Re: multiple UndoManagers
- Subject: Re: multiple UndoManagers
- From: Graham Cox <email@hidden>
- Date: Sun, 6 Jul 2008 14:33:16 +1000
I've done a lot of stuff recently with Undo in my DrawKit project,
which sounds a little like what you are doing also. I have to say,
having one undo manager per object sounds like a recipe for confusion.
It's just not how undo is intended to work, and not how users expect
Undo to work.
In DK, I have one undo manager per document which is the common model,
and all undo operations for any object go to the same UM. Normally,
you do not select the target for the undo manager when *undoing* - the
target is recorded when *doing*. Then when the user invokes undo it
just backtracks through all the operations you did - it knows what the
target object is for each op, you shouldn't need to select it. Where
you can interactively select objects (as in DK), the undo manager also
records the selection state, but only along with any actual data
changes made - simply changing the selection isn't normally recorded
as an undoable task in itself. Then when the user undoes several
things, the selection state also backtracks with it, so it's clear
(and automatic) what object was affected by the undo.
By having one undo manager, it's also easy to manage the text in the
undo menu item to say what is going to be undone. Only by using the
undo manager in this expected way is this as easy as this - doing it
your way you'll have to force a menu change every time your selection
changes, which is probably possible, but definitely not the expected
way to do it. You say "it needs to be this way" but why? It's so
bizarre it's unlikely to win any friends amongst your app's users, and
surely, doing it the conventional way is a much easier programming
task too?
cheers, Graham
On 5 Jul 2008, at 9:07 pm, Georg Seifert wrote:
Hello,
I have a rather complicated undo setting
My document Object has a Array of independent graphical items
(containing some properties).
Each item should have its own undo/redo based of selection in the
interface. So I select Item_1, modify it, select Item_2 and modify
it, too. Then I want to be able to select item_1 again and undo its
changes.
I know that this is very unusual and may confuse users but it needs
to be this way.
I have a Instance of NSUndoManager in each of my items. But how do I
tell the menu which undoManager is "active" (to display an
appropriate actionName).
any suggestion is welcome.
Thanks in advance
Georg
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden