#include <optspage.h>
Inheritance diagram for ActionPageResize:
Public Member Functions | |
ActionPageResize () | |
ActionPageResize constructor. | |
~ActionPageResize () | |
ActionPageResize destructor. | |
virtual ActionCode | Execute () |
Executes the ActionPageResize to go and resize the current spread/page and generates another ActionPageResize to undo this change. Forces a redraw of the parent document for the specified spread. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *const pOp, ActionList *pActionList, UINT32 ActionSize, Spread *pSpread, MILLIPOINT Width, MILLIPOINT Height, MILLIPOINT Margin, MILLIPOINT Bleed, BOOL Dps, BOOL ShowDropShadow, 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 | |
Spread * | pSpread |
DocRect | PasteboardRect |
DocRect | PageRect |
MILLIPOINT | Width |
MILLIPOINT | Height |
MILLIPOINT | Margin |
MILLIPOINT | Bleed |
BOOL | Dps |
BOOL | ShowDropShadow |
Definition at line 287 of file optspage.h.
|
ActionPageResize constructor.
Definition at line 2000 of file optspage.cpp.
|
|
ActionPageResize destructor.
Definition at line 2016 of file optspage.cpp.
|
|
Executes the ActionPageResize to go and resize the current spread/page and generates another ActionPageResize to undo this change. Forces a redraw of the parent document for the specified spread.
Reimplemented from Action. Definition at line 2037 of file optspage.cpp. 02038 { 02039 ActionPageResize PageResizeAct; 02040 ActionCode ActCode = AC_FAIL; 02041 02042 02043 // Get the details on the present page layout so that we can use this to undo what we 02044 // are about to try and do 02045 MILLIPOINT PageWidth = 0; 02046 MILLIPOINT PageHeight = 0; 02047 MILLIPOINT PageMargin = 0; 02048 MILLIPOINT PageBleed = 0; 02049 BOOL PresentDps = 0; 02050 BOOL PresentDropShadow = 0; 02051 02052 if (pSpread != NULL) 02053 { 02054 pSpread->GetPageSize(&PageWidth, &PageHeight, &PageMargin, &PageBleed, 02055 &PresentDps, &PresentDropShadow); 02056 } 02057 02058 // Create an action to restore the changes we are about to make 02059 if ((ActCode = ActionPageResize::Init(pOperation, 02060 pOppositeActLst, 02061 sizeof(ActionPageResize), 02062 pSpread, 02063 PageWidth, 02064 PageHeight, 02065 PageMargin, 02066 PageBleed, 02067 PresentDps, 02068 PresentDropShadow, 02069 ( Action**)(&PageResizeAct))) != AC_FAIL) 02070 { 02071 // Need to do something here 02072 if (pSpread != NULL) 02073 { 02074 // Save away the current spreads pasteboard rectangle as the specified margin 02075 // may be overridden if the bounding rectangle of the objects on the page would 02076 // not fit into a rectangle encompassing the new page structure and having a 02077 // margin gap around all 4 sides. 02078 PasteboardRect = pSpread->GetPasteboardRect(); 02079 02080 pSpread->SetPageSize(Width, Height, Margin, Bleed, Dps, ShowDropShadow); 02081 02082 02083 // Force all views onto the document to be updated 02084 Document *pParentDoc = (Document *)pSpread->FindOwnerDoc(); 02085 if (pParentDoc != NULL) 02086 { 02087 pParentDoc->ForceRedraw(); 02088 02089 BROADCAST_TO_ALL(OptionsChangingMsg( 02090 pParentDoc, 02091 OptionsChangingMsg::NEWPAGESIZE 02092 ) 02093 ); 02094 } 02095 } 02096 } 02097 02098 return (ActCode); 02099 }
|
|
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.
AC_OK : The action was successfully initialised and added to the operation. The function calls the Action::Init function passing the runtime class of an ActionPageResize.
Definition at line 2153 of file optspage.cpp. 02164 { 02165 ActionCode Ac = (Action::Init(pOp, 02166 pActionList, 02167 ActionSize, 02168 CC_RUNTIME_CLASS(ActionPageResize), 02169 NewAction)); 02170 if (*NewAction != NULL) 02171 { 02172 ActionPageResize *ACC = (ActionPageResize*) (*NewAction); 02173 ACC->pSpread = pTheSpread; 02174 ACC->Width = NewWidth; 02175 ACC->Height = NewHeight; 02176 ACC->Margin = NewMargin; 02177 ACC->Bleed = NewBleed; 02178 ACC->Dps = NewDps; 02179 ACC->ShowDropShadow = NewShowDropShadow; 02180 } 02181 02182 return (Ac); 02183 }
|
|
Definition at line 318 of file optspage.h. |
|
Definition at line 319 of file optspage.h. |
|
Definition at line 316 of file optspage.h. |
|
Definition at line 317 of file optspage.h. |
|
Definition at line 313 of file optspage.h. |
|
Definition at line 312 of file optspage.h. |
|
Definition at line 310 of file optspage.h. |
|
Definition at line 320 of file optspage.h. |
|
Definition at line 315 of file optspage.h. |