NSUndoManager provides the setActionName:
method
to qualify the Undo and Redo command titles in the Edit menu. You
pass the string you want appended to “Undo” and “Redo” in
the menu items when the current undo group is at the top of the
undo and redo stacks. Take, as an example, a graphics application
that allows users to add circles, fill them with a color, and delete
them. With this method, you could set the name of each action to “Delete”,
“Fill”, and “Add Circle”. Upon successive undos, the Undo
menu item shows up as “Undo Delete,” “Undo Fill,” and “Undo
Add Circle.”
NSUndoManager automatically localizes the “Undo” and “Redo”
portion of the command titles, but merely appends the action name
to them. You should localize the action names yourself. If you want
to further customize how these titles are localized, override undoMenuTitleForUndoActionName:
and redoMenuTitleForUndoActionName:
.
© 2002 Apple Computer, Inc. All Rights Reserved. (Last updated: 2002-11-12)