LayerColourAction Class Reference

An action which changes the colour of a guide layer. More...

#include <prpsgds.h>

Inheritance diagram for LayerColourAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 LayerColourAction ()
 Constructor for the action.
 ~LayerColourAction ()
virtual ActionCode Execute ()
 Executes the action. Puts the action's layer's visible state to the opposite setting.

Static Public Member Functions

static ActionCode Init (UndoableOperation *pOp, ActionList *pActionList, OpChangeLayerColourParam Param)
 The action that does the layer colour change biz.

Protected Attributes

OpChangeLayerColourParam Param

Detailed Description

An action which changes the colour of a guide layer.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/95
See also:
-

Definition at line 300 of file prpsgds.h.


Constructor & Destructor Documentation

LayerColourAction::LayerColourAction  ) 
 

Constructor for the action.

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

Errors: -

See also:
-

Definition at line 1030 of file prpsgds.cpp.

01031 {
01032 }

LayerColourAction::~LayerColourAction  ) 
 

Definition at line 1125 of file prpsgds.cpp.

01126 {
01127 }


Member Function Documentation

ActionCode LayerColourAction::Execute  )  [virtual]
 

Executes the action. Puts the action's layer's visible state to the opposite setting.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Reimplemented from Action.

Definition at line 1108 of file prpsgds.cpp.

01109 {
01110     ActionCode Ac = AC_FAIL;
01111 
01112     if (pOperation->IS_KIND_OF(UndoableOperation))
01113     {
01114         Ac = LayerColourAction::Init((UndoableOperation*)pOperation,pOppositeActLst,Param);
01115 
01116     }
01117     else
01118     {
01119         ERROR3("LayerColourAction::Execute() called with op that's not an undoable op");
01120     }
01121 
01122     return Ac;
01123 }

ActionCode LayerColourAction::Init UndoableOperation pOp,
ActionList pActionList,
OpChangeLayerColourParam  EntryParam
[static]
 

The action that does the layer colour change biz.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/95
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added Param = Contains all the info needed to change the layer's colour
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 1056 of file prpsgds.cpp.

01059 {
01060     UINT32 ActSize = sizeof(LayerColourAction);
01061 
01062     LayerColourAction* pNewAction;
01063     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(LayerColourAction),(Action**)&pNewAction);
01064 
01065     if (Ac != AC_FAIL && pNewAction != NULL)
01066     {
01067         OpChangeLayerColourParam& Param = ((LayerColourAction*)pNewAction)->Param;
01068 
01069         Document* pDoc   = EntryParam.pDoc;
01070         Layer*    pLayer = EntryParam.pLayer;
01071 
01072         Param.pDoc   = pDoc;
01073         Param.pLayer = pLayer;
01074 
01075         if (pDoc != NULL && pLayer != NULL)
01076         {
01077             DocColour* pDocColour = pLayer->GetGuideColour();
01078             Param.pColour = pDocColour->FindParentIndexedColour();
01079 
01080             pLayer->SetGuideColour(EntryParam.pColour);
01081             LayerSGallery::ForceRedrawLayer(pDoc,pLayer);
01082             BROADCAST_TO_ALL(LayerMsg(pLayer,LayerMsg::GUIDELINES_CHANGED));
01083         }
01084 
01085         ERROR3IF(pDoc == NULL,  "pDoc is NULL");            
01086         ERROR3IF(pLayer == NULL,"pLayer is NULL");          
01087     }
01088 
01089     return Ac;
01090 }


Member Data Documentation

OpChangeLayerColourParam LayerColourAction::Param [protected]
 

Definition at line 313 of file prpsgds.h.


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