|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Cocoa||MBS CocoaBase Plugin||8.4||Yes||No||No||Yes, macOS only||No|
You register an undo operation by specifying the object that's changing (or the owner of that object), along with a method to invoke to revert its state, and the arguments for that method. When performing undo an NSUndoManager saves the operations reverted so that you can redo the undos. If used in a Cocoa Application Kit-based application, NSUndoManager groups all operations within a single cycle of the run loop, so that performing an undo reverts all changes that occurred during the cycle.
NSUndoManager is implemented as a class of the Foundation framework because executables other than applications might want to revert changes to their states. For example, you might have an interactive command-line tool with undo and redo commands, or there could be distributed object implementations that can revert operations "over the wire." However, users typically see undo and redo as application features. The Application Kit implements undo and redo in its NSTextView object and makes it easy to implement it in objects along the responder chain.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 3 properties
- 22 methods
- method beginUndoGrouping
- method canRedo as boolean
- method canUndo as boolean
- method Constructor
- method disableUndoRegistration
- method enableUndoRegistration
- method endUndoGrouping
- method groupingLevel as Integer
- method isRedoing as boolean
- method isUndoing as boolean
- method isUndoRegistrationEnabled as boolean
- method redo
- method redoActionName as string
- method redoMenuItemTitle as string
- method redoMenuTitleForUndoActionName(actionName as string) as string
- method removeAllActions
- method setActionName(actionName as string)
- method undo
- method undoActionName as string
- method undoMenuItemTitle as string
- method undoMenuTitleForUndoActionName(actionName as string) as string
- method undoNestedGroup
This class has no sub classes.
Some methods using this class:
- NSResponderMBS.undoManager as NSUndoManagerMBS
Some events for this class:
Some examples which use this class:
- /CocoaControls/TextEdit MBS
- /Leopard/Cocoa Controls/TextView
- /Leopard/Cocoa Controls/TextView with events
The items on this page are in the following plugins: MBS CocoaBase Plugin.
MBS Xojo tutorial videos