#include <oppull.h>
Inheritance diagram for OpPullOntoGrid:
Public Member Functions | |
virtual void | Do (OpDescriptor *pOpDesc) |
The pull onto grid op's Do() function. | |
Static Public Member Functions | |
static BOOL | Init () |
OpPullOntoGrid initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding OpPullOntoGrid's state. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpPullOntoGrid) |
Definition at line 117 of file oppull.h.
|
|
|
The pull onto grid op's Do() function.
Reimplemented from Operation. Definition at line 200 of file oppull.cpp. 00201 { 00202 DocCoord Offset; 00203 TransformData TransData; 00204 00205 // Set up the transform data 00206 TransData.CentreOfTrans.x = 0; 00207 TransData.CentreOfTrans.y = 0; 00208 TransData.StartBlob = 0; 00209 TransData.LockAspect = TRUE; 00210 TransData.LeaveCopy = FALSE; 00211 TransData.ScaleLines = FALSE; 00212 TransData.TransFills = TRUE; 00213 TransData.pRange = 0; 00214 00215 SelRange* pSel = GetApplication()->FindSelection(); 00216 if (pSel) 00217 { 00218 // Set up the Offset DocCoord to contain the X and Y translation values 00219 DocRect Bounds = pSel->GetBoundingRect(); 00220 DocCoord Offset = Bounds.lo; 00221 DocView::ForceSnapToGrid(Document::GetSelectedSpread(),&Offset); 00222 Offset = Offset - Bounds.lo; 00223 00224 // Call OpTranslateTrans::DoWithParams() with a ptr to the transform data and a ptr to a DocCoord 00225 // that specs the X and Y offsets of the translation 00226 OpParam temp((void *)&TransData, (void *)&Offset); 00227 DoWithParam(pOpDesc, &temp); 00228 } 00229 }
|
|
For finding OpPullOntoGrid's state.
Reimplemented from TransOperation. Definition at line 169 of file oppull.cpp. 00170 { 00171 OpState OpSt; 00172 00173 SelRange* pSelRange = GetApplication()->FindSelection(); 00174 if (pSelRange != NULL && pSelRange->FindFirst() != NULL) 00175 OpSt.Greyed = FALSE; 00176 else 00177 OpSt.Greyed = TRUE; 00178 00179 return (OpSt); 00180 }
|
|
OpPullOntoGrid initialiser method.
Reimplemented from SimpleCCObject. Definition at line 137 of file oppull.cpp. 00138 { 00139 BOOL registered = RegisterOpDescriptor( 00140 0, 00141 _R(IDS_PULLONTOGRID), 00142 CC_RUNTIME_CLASS(OpPullOntoGrid), 00143 OPTOKEN_PULLONTOGRID, 00144 OpPullOntoGrid::GetState, 00145 0, 00146 _R(IDBBL_PULLONTOGRID) 00147 ); 00148 return registered; 00149 }
|