OpDeleteAllGuidelines Class Reference

Allows guides to be Deleted. More...

#include <guides.h>

Inheritance diagram for OpDeleteAllGuidelines:

OpGuideline UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpDeleteAllGuidelines ()
 Default constructor.
 ~OpDeleteAllGuidelines ()
 Default destructor.
virtual void Do (OpDescriptor *pOpDesc)
 Creates then opens the dialog.

Static Public Member Functions

static OpState GetState (String_256 *Description, OpDescriptor *)
 Func for determining the usability of this op.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDeleteAllGuidelines)

Detailed Description

Allows guides to be Deleted.

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

Definition at line 382 of file guides.h.


Constructor & Destructor Documentation

OpDeleteAllGuidelines::OpDeleteAllGuidelines  ) 
 

Default constructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
UndoableOperation

Definition at line 2456 of file guides.cpp.

02457 {
02458     UndoIDS = _R(IDS_OPDELETEALLGUIDELINES);
02459 }

OpDeleteAllGuidelines::~OpDeleteAllGuidelines  ) 
 

Default destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
UndoableOperation

Definition at line 2475 of file guides.cpp.

02476 {
02477 }


Member Function Documentation

OpDeleteAllGuidelines::CC_DECLARE_DYNCREATE OpDeleteAllGuidelines   )  [private]
 

void OpDeleteAllGuidelines::Do OpDescriptor pOpDesc  )  [virtual]
 

Creates then opens the dialog.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 2494 of file guides.cpp.

02495 {
02496     BOOL ok = FALSE;
02497 
02498     Spread* pSpread = Document::GetSelectedSpread();
02499     if (pSpread != NULL)
02500     {
02501         Layer* pLayer = pSpread->FindFirstGuideLayer();
02502         if (pLayer != NULL)
02503         {
02504             ok = TRUE;
02505             Node* pNode = pLayer->FindFirstChild(CC_RUNTIME_CLASS(NodeGuideline));
02506             while (pNode != NULL)
02507             {
02508                 Node* pNextNode = pNode->FindNext(CC_RUNTIME_CLASS(NodeGuideline));
02509                 ok = ok && DoDeleteGuideline((NodeGuideline*)pNode);
02510                 pNode = pNextNode;
02511             }
02512         }
02513     }
02514 
02515     if (!ok)
02516         FailAndExecute();
02517     else
02518         BroadcastGuidelineChanges(pSpread->FindFirstGuideLayer());
02519 
02520     End();
02521 }

OpState OpDeleteAllGuidelines::GetState String_256 Description,
OpDescriptor
[static]
 

Func for determining the usability of this op.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/10/95
Parameters:
Description = ptr to place description of why this op can't happen [INPUTS] pOpDesc = ptr to the Op Desc associated with this op
- [OUTPUTS]
Returns:
An OpState object
See also:
-

Reimplemented from OpGuideline.

Definition at line 2538 of file guides.cpp.

02539 {
02540     OpState State(FALSE,TRUE);      // Greyed out by default
02541 
02542     Spread* pSpread = Document::GetSelectedSpread();
02543     if (pSpread != NULL)
02544     {
02545         Layer* pLayer = pSpread->FindFirstGuideLayer();
02546         if (pLayer != NULL)
02547         {
02548             Node* pNode = pLayer->FindFirstChild(CC_RUNTIME_CLASS(NodeGuideline));
02549             State.Greyed = (pNode == NULL);     // Ungrey if there are one or more guidelines
02550         }
02551     }
02552 
02553     if (State.Greyed)
02554         Description->Load(_R(IDS_OPDELETEALLGUIDESGREY));
02555 
02556     return State;
02557 }


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