On Jul 5, 2008, at 11:37, Georg Seifert wrote:

But than I have just another question: If I select more than one object. All the handling of the undos of the single object I can do in the undo/redo functions of my delegate. But how do I tell the menu that the is "something" to undo? I would return a dummy undoManager? How do I set this up?

For now I can live with it that undo only works with on object selected but it would be very convenient for the users to have it in the long term.

But the real question is, if you have multiple objects selected, which is the desired effect of Undo? Undo the last operation in each selected object? Undo the most recent operation done in any of the selected objects? How will the user know what the effect of choosing Undo will be? Without knowing the context of the problem, it sort of sounds like a terrible idea. :)

If you must do something complicated, I suppose you could create an additional undo manager (the "multiple selection" undo manager). Each time a multiple selection is made, load this undo manager up with a series of special undo actions that represent whatever behavior you want to undoing to have, and return it via "windowWillReturnUndoManager:". These special undo actions would be implemented as a series of invocations of undos to the individual undo managers, presumably.

Or something like that.

Keep in mind that getting redo to work right in all cases might be hard or impossible. NSWindow does something along this line, using 2 undo managers, when you type into a text field in a document window whose document has its own undo manager. But NSWindow actually gets redo wrong in this situation.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to