SelectDeselectAction Class Reference

When executed this action will render node's selection blobs (which could remove them) and set it's selection state. If the node is currently selected then the node is deselected. If the node is currently deselected it is selected. It creates a second SelectDeselectAction for the node and adds it to the opposite action list. More...

#include <ops.h>

Inheritance diagram for SelectDeselectAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 SelectDeselectAction ()
 SelectDeselectAction constructor.
 ~SelectDeselectAction ()
virtual ActionCode Execute ()
 Executes the SelectDeselectAction which will render node's selection blobs (which could remove them), and set it's selection state. If node is currently selected then the node is deselected. If node is currently deselected it is selected. It creates a second SelectDeselectAction for the node and adds it to the opposite action list.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, Node *SelDeNode, Spread *pSpread, 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.

Public Attributes

Nodenode
SpreadParent

Detailed Description

When executed this action will render node's selection blobs (which could remove them) and set it's selection state. If the node is currently selected then the node is deselected. If the node is currently deselected it is selected. It creates a second SelectDeselectAction for the node and adds it to the opposite action list.

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

Definition at line 1093 of file ops.h.


Constructor & Destructor Documentation

SelectDeselectAction::SelectDeselectAction  ) 
 

SelectDeselectAction constructor.

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

Errors: -

See also:
-

Definition at line 4448 of file ops.cpp.

04449 {
04450 }

SelectDeselectAction::~SelectDeselectAction  ) 
 

Definition at line 4452 of file ops.cpp.

04453 {
04454 }


Member Function Documentation

ActionCode SelectDeselectAction::Execute  )  [virtual]
 

Executes the SelectDeselectAction which will render node's selection blobs (which could remove them), and set it's selection state. If node is currently selected then the node is deselected. If node is currently deselected it is selected. It creates a second SelectDeselectAction for the node and adds it to the opposite action list.

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 4476 of file ops.cpp.

04477 {  
04478     SelectDeselectAction* SelDeAct;  
04479     ActionCode ActCode;  
04480     // Attempt to initialise the action    
04481     if ((ActCode = SelectDeselectAction::Init(pOperation,                    
04482                                               pOppositeActLst,  
04483                                               node,
04484                                               Parent,
04485                                               ( Action**)(&SelDeAct))) != AC_FAIL) 
04486     {   
04487         // The action was successfully initialised   
04488         ENSURE((node->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk))), 
04489             "Cannot select/deselect a non NodeRenderableInk node"); 
04490             
04491         if (node->IsSelected())  
04492             ((NodeRenderableInk*)node)->DeSelect(FALSE); // DeSelect   
04493         else 
04494             ((NodeRenderableInk*)node)->Select(FALSE);  // Select 
04495     }             
04496     return (ActCode);                                       
04497 }     

ActionCode SelectDeselectAction::Init Operation *const   pOp,
ActionList pActionList,
Node SelDeNode,
Spread pSpread,
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

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

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 ShowNodeAction.

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

Definition at line 4544 of file ops.cpp.

04549 { 
04550     ActionCode Ac = (Action::Init(pOp,
04551                      pActionList,
04552                      sizeof(SelectDeselectAction), 
04553                      CC_RUNTIME_CLASS(SelectDeselectAction), 
04554                      NewAction)); 
04555                        
04556     if (Ac != AC_FAIL)
04557         if (*NewAction != NULL)
04558         {
04559             ((SelectDeselectAction*)(*NewAction))->node = SelDeNode;
04560             ((SelectDeselectAction*)(*NewAction))->Parent = pSpread;
04561         }
04562                          
04563     return (Ac); 
04564 } 


Member Data Documentation

Node* SelectDeselectAction::node
 

Definition at line 1107 of file ops.h.

Spread* SelectDeselectAction::Parent
 

Definition at line 1108 of file ops.h.


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