OpRedo Class Reference

This class represents the Redo operation. More...

#include <ophist.h>

Inheritance diagram for OpRedo:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpRedo ()
 Constructs an OpRedo object.
void Do (OpDescriptor *)
 Actually "DO" a redo operation.

Static Public Member Functions

static BOOL Init ()
 Create an OpDescriptor for the Redo operation.
static OpState GetState (String_256 *, OpDescriptor *)
 Find the state of the OpRedo operation.

Detailed Description

This class represents the Redo operation.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
See also:
OpRedo

Definition at line 274 of file ophist.h.


Constructor & Destructor Documentation

OpRedo::OpRedo  ) 
 

Constructs an OpRedo object.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1390 of file ophist.cpp.

01390               : Operation()
01391 {
01392 }


Member Function Documentation

void OpRedo::Do OpDescriptor  )  [virtual]
 

Actually "DO" a redo operation.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
An Operation Descriptor [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 1409 of file ophist.cpp.

01410 {
01411 //  ENSURE(FALSE,"Someone's trying to Redo!");
01412 
01413     // Remember our document, because in debug builds we need to access it after End()
01414     // has been called, and End() deletes the operation.
01415     Document *pDoc = pOurDoc;
01416     pDoc->GetOpHistory().RedoNext();
01417     End();          
01418     
01419     #ifdef _DEBUG      
01420     // Ensure that the size of the operation history is valid 
01421     pDoc->GetOpHistory().DebugSizeCheck();   
01422     #endif
01423 }

OpState OpRedo::GetState String_256 UIDescription,
OpDescriptor
[static]
 

Find the state of the OpRedo operation.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/8/93
Parameters:
OpDescriptor - To help update the state [INPUTS]
String - if MenuItem is enabled Then return the name of the operation to [OUTPUTS] be undone Else return the reason why it is disabled
Returns:
-

Errors: -

See also:
-

Definition at line 1443 of file ophist.cpp.

01444 {
01445     OpState OpSt;     
01446 
01447     // Undo always works on the selected document...
01448     Document *pDocument = Document::GetSelected();
01449 
01450     if (pDocument)
01451     {
01452         OperationHistory *pOpHist = &(pDocument->GetOpHistory());
01453         
01454         // Is there an Operation History?
01455         if (pOpHist)
01456         {
01457             // The Redo operation can only be invoked if there are any operations to redo.             
01458             if (pOpHist->CanRedo())
01459             {
01460                 // Temporary String used for Operation Name
01461                 String_256 OpName;
01462             
01463                 // Get the name of operation to be undone
01464                 pOpHist->GetRedoOpName(&OpName);
01465         
01466                 //Concatenate The Menu Description with the operation name
01467                 String Space = _T(" ");
01468                 *UIDescription += Space;
01469                 *UIDescription += OpName;
01470                 
01471                 return OpSt;
01472             }
01473         }
01474     }
01475 
01476     //ELSE set to state to disabled
01477 
01478     OpSt.Greyed = TRUE;
01479         
01480     // Load reason why operation is disabled
01481     String_256 DisableReason(_R(IDS_REDO_DISABLED));
01482         
01483     *UIDescription = DisableReason;
01484     
01485     return(OpSt);   
01486 }                                    

BOOL OpRedo::Init void   )  [static]
 

Create an OpDescriptor for the Redo operation.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/8/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: ERROR is called if there was insufficient memory to create the operation

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1505 of file ophist.cpp.

01506 {
01507     return(Operation::RegisterOpDescriptor( 
01508                                             0, 
01509                                             _R(IDS_EDIT_REDO),
01510                                             CC_RUNTIME_CLASS(OpRedo), 
01511                                             OPTOKEN_REDO,
01512                                             OpRedo::GetState,
01513                                             HID_EDIT_REDO,
01514                                             _R(IDBBL_REDOOP),
01515                                             _R(IDD_BARCONTROLSTORE),
01516                                             _R(IDC_BTN_EDITREDO),
01517                                             SYSTEMBAR_EDIT
01518                                             )
01519           ); 
01520 
01521 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:43 2007 for Camelot by  doxygen 1.4.4