#include <pathedit.h>
Inheritance diagram for RecordBoundsAction:
Public Member Functions | |
RecordBoundsAction () | |
Constructor for the action to recalculate bounds of a node. | |
~RecordBoundsAction () | |
virtual ActionCode | Execute () |
Will replace the bounding box of an object, recording the existing bounds. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, NodeRenderableBounded *WhichNode, Action **NewAction) |
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation. | |
static ActionCode | DoRecord (Operation *pOp, ActionList *pActionList, NodeRenderableBounded *WhichNode, BOOL OptimiseRedraw=FALSE) |
This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list. Then it invalidates the current view according to the blob rectangle of the object. | |
Protected Attributes | |
NodeRenderableBounded * | ChangedNode |
Definition at line 902 of file pathedit.h.
|
Constructor for the action to recalculate bounds of a node.
Definition at line 9872 of file pathedit.cpp.
|
|
Definition at line 10021 of file pathedit.cpp.
|
|
This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list. Then it invalidates the current view according to the blob rectangle of the object.
Definition at line 9944 of file pathedit.cpp. 09948 { 09949 ERROR3IF(OptimiseRedraw && !WhichNode->IsNodePath(),"Can't optimise redraw for a non-path object"); 09950 09951 RecordBoundsAction* RecAction; 09952 ActionCode Act = RecordBoundsAction::Init(pOp, pActionList, WhichNode, (Action**)&RecAction); 09953 if (Act != AC_FAIL) 09954 { 09955 // Force a re-draw of the place where the path used to be 09956 Document* pDoc = pOp->GetWorkingDoc(); 09957 ERROR2IF( pDoc == NULL, AC_FAIL, "There was no current document in RecordBoundsAction::DoRecord" ); 09958 09959 Spread* pSpread = WhichNode->FindParentSpread(); 09960 09961 // Do an optimised redraw if possible 09962 if (WhichNode->IsNodePath() && OptimiseRedraw) 09963 OptimiseRedraw = RecalcBoundsAction::CauseOptimisedRedraw((NodePath*)WhichNode, pDoc, pSpread); 09964 else 09965 OptimiseRedraw = FALSE; 09966 09967 if (!OptimiseRedraw) 09968 pDoc->ForceRedraw( pSpread, WhichNode->GetUnionBlobBoundingRect(), FALSE, WhichNode); 09969 } 09970 return Act; 09971 }
|
|
Will replace the bounding box of an object, recording the existing bounds.
Reimplemented from Action. Definition at line 9989 of file pathedit.cpp. 09990 { 09991 // This is undoing a bounds recalculation 09992 09993 RecalcBoundsAction* ReAction; 09994 09995 // Create a redo action for this action, which is also a RecalcBoundsAction 09996 09997 ActionCode Act; 09998 Act = RecalcBoundsAction::Init(pOperation, 09999 pOppositeActLst, 10000 ChangedNode, 10001 (Action**)(&ReAction)); 10002 if (Act == AC_FAIL) 10003 return AC_FAIL; 10004 10005 // Force a re-draw of the place where the path used to be 10006 Document* pDoc = GetWorkingDoc(); 10007 ERROR2IF( pDoc == NULL, AC_FAIL, "There was no current document when undoing RecalcBounds" ); 10008 Spread* pSpread = ChangedNode->FindParentSpread(); 10009 10010 if (pSpread != NULL) 10011 { 10012 DocRect Invalid = ChangedNode->GetUnionBlobBoundingRect(); 10013 pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedNode ); 10014 } 10015 10016 return Act; 10017 }
|
|
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
Definition at line 9904 of file pathedit.cpp. 09908 { 09909 UINT32 ActSize = sizeof(RecordBoundsAction); 09910 09911 ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(RecordBoundsAction), NewAction); 09912 if ((Ac == AC_OK) && (*NewAction != NULL)) 09913 ((RecordBoundsAction*)*NewAction)->ChangedNode = WhichNode; 09914 09915 return Ac; 09916 }
|
|
Definition at line 920 of file pathedit.h. |