[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LUndoer



Overview:

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:

 

LUndoer()  
~LUndoer()  
ExecuteSelf()  
FindUndoStatus()  
PostAction()  
ToggleAction()  
operator=()  
 

Data Members:

The data members in this class are:

 

mAction  
 

Operation:

In a typical application having a single-level undo, you should not have to call the LUndoer member functions directly.

Source files:

(Action Classes)

LUndoer.h

LUndoer.cp

Ancestors:

LAttachment

See Also:

LAction

LAttachment

LCommander

LUndoer()

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:

None

~LUndoer()

Purpose:

The destructor destroys the object.

Access:

Public, Virtual

Prototype:

virtual ~LUndoer();
Parameters:

None

ExecuteSelf()

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:

Virtual, Protected

Prototype:

virtual void ExecuteSelf( MessageT inMessage,
void *ioParam);
Parameters:

This method has the following parameters:

 

MessageT  
inMessage  
This is the message that is being received.  
void*  
ioParam  
This is a pointer to a parameter that accompanies the message.  

Return:

None

FindUndoStatus()

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:

Virtual, Protected

Prototype:

virtual void FindUndoStatus( SCommandStatus
*ioStatus);
Parameters:

This method has the following parameter:

 

SCommandStatus*  
ioStatus  
This is a pointer to a structure containing status information for the command.  

Return:

None

PostAction()

Purpose:

This method handles a new Action that is posted.

Access:

Virtual, Protected

Prototype:

virtual void PostAction( LAction *inAction );
Parameters:

This method has the following parameter:

 

LAction*  
inAction  
This is a pointer to LAction object that indicates an Action to be taken.  

Return:

None

ToggleAction()

Purpose:

Undo/Redo the Action associated with this Undoer, held in the member mAction.

Access:

Virtual, Protected

Prototype:

virtual void ToggleAction();
Parameters:

None

Return:

None

operator=()

Purpose:

Overloads the assignment operator so that the compiler will not substitute a default.

Access:

Private

Prototype:

LUndoer& operator=( const LUndoer &inOriginal );
Parameters:

This operator takes the following parameter:

 

const LUndoer&  
inOriginal  
A reference to an LUndoer object.  

Return:

Returns a reference to an LUndoer object.

mAction

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:

Protected

Prototype:

LAction *mAction;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000