OpResetSpreadOrigin Class Reference

op to reset the spread (user and grid) origin More...

#include <guides.h>

Inheritance diagram for OpResetSpreadOrigin:

OpSpreadOrigin OpGridResize UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpResetSpreadOrigin ()
 Default constructor.
virtual void Do (OpDescriptor *pOpDesc)
 Sets up params to set origin to page origin and invokes OpSpreadOrigin::DoChangeOrigin().

Static Public Member Functions

static BOOL Init ()
 Initilise OpResetSpreadOrigin.
static OpState GetState (String_256 *pReasonGreyed, OpDescriptor *pOpDesc)

Private Member Functions

 CC_DECLARE_DYNCREATE (OpResetSpreadOrigin)

Detailed Description

op to reset the spread (user and grid) origin

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95

Definition at line 485 of file guides.h.


Constructor & Destructor Documentation

OpResetSpreadOrigin::OpResetSpreadOrigin  ) 
 

Default constructor.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95

Definition at line 3185 of file guides.cpp.

03186 {
03187 }


Member Function Documentation

OpResetSpreadOrigin::CC_DECLARE_DYNCREATE OpResetSpreadOrigin   )  [private]
 

void OpResetSpreadOrigin::Do OpDescriptor pOpDesc  )  [virtual]
 

Sets up params to set origin to page origin and invokes OpSpreadOrigin::DoChangeOrigin().

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95
Parameters:
pOpDesc - not used [INPUTS]

Reimplemented from OpSpreadOrigin.

Definition at line 3223 of file guides.cpp.

03224 {
03225     Spread* pSpread = Document::GetSelectedSpread();
03226     ERROR3IF(pSpread==NULL,"OpResetSpreadOrigin::Do() - no seleted spread");
03227     DocCoord PageOrigin(0,0);
03228     BOOL ok = (pSpread!=NULL);
03229     if (ok) ok = pSpread->PagesCoordToSpreadCoord(&PageOrigin,DocCoord(0,0));
03230     if (ok) ok = DoChangeOrigin(pSpread,PageOrigin);
03231 
03232     if (!ok)
03233         FailAndExecute();
03234     End();
03235 }

OpState OpResetSpreadOrigin::GetState String_256 pReasonGreyed,
OpDescriptor pOpDesc
[static]
 

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95
Parameters:
pOpDesc - [INPUTS]
pReasonGreyed - [OUTPUTS]
Returns:
An OpState object

Reimplemented from OpSpreadOrigin.

Definition at line 3248 of file guides.cpp.

03249 {
03250     OpState state(FALSE,TRUE);  // assume it will be greyed - for returning errors
03251 
03252     Spread* pSpread = Document::GetSelectedSpread();
03253     if (pSpread!=NULL)
03254     {
03255         DocCoord UserOrigin = UserCoord(0,0).ToSpread(pSpread);
03256         DocCoord PageOrigin(0,0);
03257         if (pSpread->PagesCoordToSpreadCoord(&PageOrigin,DocCoord(0,0))!=FALSE)
03258             state.Greyed = (UserOrigin==PageOrigin);
03259     }
03260     else
03261         ERROR3("OpResetSpreadOrigin::GetState() - no seleted spread");
03262 
03263     if (state.Greyed && pReasonGreyed!=NULL)
03264         pReasonGreyed->Load(_R(IDS_OPRESETSPREADORIGINGREY));
03265 
03266     return state;
03267 }

BOOL OpResetSpreadOrigin::Init void   )  [static]
 

Initilise OpResetSpreadOrigin.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95
Returns:
FALSE if fails

Reimplemented from OpSpreadOrigin.

Definition at line 3199 of file guides.cpp.

03200 {
03201     return RegisterOpDescriptor(0, 
03202                                 _R(IDS_OPRESETSPREADORIGIN),
03203                                 CC_RUNTIME_CLASS(OpResetSpreadOrigin), 
03204                                 OPTOKEN_RESETSPREADORIGIN ,
03205                                 OpResetSpreadOrigin::GetState,
03206                                 0,  /* help ID */
03207                                 0,  /* bubble ID */
03208                                 0   /* bitmap ID */
03209                                 );
03210 }


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