ChangeLyrAttribAction Class Reference

When executed the ChangeLyrAttribAction changes a layer's Status. More...

#include <layermgr.h>

Inheritance diagram for ChangeLyrAttribAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ChangeLyrAttribAction ()
 ChangeLyrAttribAction constructor.
 ~ChangeLyrAttribAction ()
 ChangeLyrAttribAction destructor.
virtual ActionCode Execute ()
 Executes the ChangeLyrAttribAction.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, UINT32 ActionSize, LayerStatus &Status, Layer *Layer, Action **NewAction)
 To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Private Attributes

Layer * ChangeLayer
LayerStatus Status

Detailed Description

When executed the ChangeLyrAttribAction changes a layer's Status.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/1/94
See also:
-

Definition at line 262 of file layermgr.h.


Constructor & Destructor Documentation

ChangeLyrAttribAction::ChangeLyrAttribAction (   ) 
 

ChangeLyrAttribAction constructor.

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

Errors: -

See also:
-

Definition at line 982 of file layermgr.cpp.

00983 {
00984 }

ChangeLyrAttribAction::~ChangeLyrAttribAction (   ) 
 

ChangeLyrAttribAction destructor.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/1/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1003 of file layermgr.cpp.

01004 { 
01005 
01006 }   


Member Function Documentation

ActionCode ChangeLyrAttribAction::Execute (   )  [virtual]
 

Executes the ChangeLyrAttribAction.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
- [INPUTS]
ActionCode indicating if the action was successfully executed or not [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Action.

Definition at line 1026 of file layermgr.cpp.

01027 {  
01028    ChangeLyrAttribAction ChngLyrAct; 
01029    ActionCode ActCode;  
01030 
01031      // Create an action to restore the changes we are about to make  
01032     if ((ActCode = ChangeLyrAttribAction::Init(pOperation,                    
01033                                                pOppositeActLst,  
01034                                                sizeof(ChangeLyrAttribAction),  
01035                                                ChangeLayer->GetLayerStatus(),  // The current status
01036                                                ChangeLayer,       
01037                                                ( Action**)(&ChngLyrAct))) != AC_FAIL) 
01038     { 
01039         // Remove the layers selection blobs if we are about to make the layer invisible,
01040         // or if we are about to lock the layer. 
01041         //if ((Status.Flags.Locked) || 
01042         //   (!(Status.Flags.Visible)))
01043         //{
01044         //  NodeRenderableInk::DeselectAllOnLayer( ChangeLayer );
01045         //}
01046 
01047         // Preserve the Active flag of the changing layer
01048         LayerStatus CurrentStatus = ChangeLayer->GetLayerStatus();
01049         //Status.Flags.Active = CurrentStatus.Flags.Active;
01050 
01051         // Change the layer's status  
01052         ChangeLayer->SetLayerStatus(Status); 
01053     }             
01054     return (ActCode);                
01055 }     

ActionCode ChangeLyrAttribAction::Init (  Operation *const   pOp,
ActionList *  pActionList,
UINT32  ActionSize,
LayerStatus &  Status,
Layer *  Layer,
Action **  NewAction
)  [static]
 

To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/93
Parameters:
pOp,: The operation to which the action should be added [INPUTS]
pActionList: The action list in the operation object

ActionSize: The size of the action in bytes. This should be the total size of the action (including any objects pointed to by the action).

Status: The status which is restored when executed Layer: The layer to change when we execute

Parameters:
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
AC_FAIL: There was not enough room in the operation history for the action and the user did not wish to continue. Usually End() should be called in this situation.
AC_NORECORD: There was not enough room in the operation history for the action, but the user requested that he wished to continue without undo.

AC_OK : The action was successfully initialised and added to the operation.

The function calls the Action::Init function passing the runtime class of a ChangeLyrAttribAction.

Returns:
Errors: -
See also:
Action::Init

Definition at line 1107 of file layermgr.cpp.

01116 {    
01117 
01118     ActionCode Ac = (Action::Init(pOp,
01119                      pActionList,
01120                      ActionSize,
01121                      CC_RUNTIME_CLASS(ChangeLyrAttribAction), 
01122                      NewAction));
01123                          
01124     if (*NewAction != NULL) // The action has been allocated 
01125     {
01126         ((ChangeLyrAttribAction*)(*NewAction))->ChangeLayer = Layer;
01127         ((ChangeLyrAttribAction*)(*NewAction))->Status = Status; 
01128     }
01129     return (Ac); 
01130 }


Member Data Documentation

Layer* ChangeLyrAttribAction::ChangeLayer [private]
 

Definition at line 279 of file layermgr.h.

LayerStatus ChangeLyrAttribAction::Status [private]
 

Definition at line 280 of file layermgr.h.


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