LUndoer is a PowerPlant class that helps manage the do, undo, and redo operations. It works in conjunction with LAction.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
In a typical application having a single-level undo, you should not have to call the LUndoer member functions directly.
Source files:
Ancestors:
See Also:
Purpose :
The default constructor initializes the data member. The copy constructor provides a definition so that the compiler does not supply a default copy constructor for this object.
Access:
Public (default constructor) and Private (copy constructor).
Prototype:
LUndoer(); /* default constructor */
LUndoer( const LUndoer &inOriginal ); /* pvt copy */Parameters:
Purpose:
The destructor destroys the object.
Access:
Prototype:
virtual ~LUndoer();Parameters:
Purpose:
This method intercepts messages for the host. When called with
a msg_PostAction message it calls SetExecuteHost() with the new action to perform. When called with a msg_CommandStatus message it enables and sets the text for the Undo menu item using
FindUndoStatus(). When called with a cmd_Undo message it toggles betweenUndoing/Redoing the Action using ToggleAction(). If called with any other message, SetExecuteHost() is called with a value of true.
Access:
Prototype:
virtual void ExecuteSelf( MessageT inMessage,Parameters:
void *ioParam);
This method has the following parameters:
Return:
Purpose:
This method will enable/disable and set the text for the Undo menu item. The menu item can be set to the Redo string, Undo string, or Can't Undo string depending on whether mAction is undoable or redoable.
Access:
Prototype:
virtual void FindUndoStatus( SCommandStatusParameters:
*ioStatus);
This method has the following parameter:
Return:
Purpose:
This method handles a new Action that is posted.
Access:
Prototype:
virtual void PostAction( LAction *inAction );Parameters:
This method has the following parameter:
Return:
Purpose:
Undo/Redo the Action associated with this Undoer, held in the member mAction.
Access:
Prototype:
virtual void ToggleAction();Parameters:
Return:
Purpose:
Overloads the assignment operator so that the compiler will not substitute a default.
Access:
Prototype:
LUndoer& operator=( const LUndoer &inOriginal );Parameters:
This operator takes the following parameter:
Return:
Returns a reference to an LUndoer object.
Purpose:
This data member stores a pointer to the action object that encapsulates the user's most recent action. Because the Undoer ot can send messages to the action object telling it to redo or undo itself.
Access:
Prototype:
LAction *mAction;