#include <blobby.h>
Inheritance diagram for BlobbyOp:
Public Member Functions | |
BlobbyOp () | |
BlobbyOp constructor. | |
void | Do (OpDescriptor *) |
Performs the BlobbyOp for the first time. | |
Static Public Member Functions | |
static BOOL | Init () |
BlobyOp initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the BlobbyOp's state. |
Definition at line 126 of file blobby.h.
|
BlobbyOp constructor.
Definition at line 172 of file blobby.cpp. 00172 : UndoableOperation() 00173 { 00174 }
|
|
Performs the BlobbyOp for the first time.
Reimplemented from Operation. Definition at line 243 of file blobby.cpp. 00244 { 00245 #if 1 00246 ActionCode ActCode; 00247 UndoColAction* UndoColAct; 00248 00249 // Attempt to initialise the first action for blobby op 00250 if ((ActCode = UndoColAction::Init(this, 00251 &UndoActions, 00252 10, 00253 (Action**)(&UndoColAct))) != AC_FAIL) // 10 is bodge 00254 // If the action was successfully initialised i.e. AC_OK or AC_NO_RECORD then 00255 // record the current colour of a page in the undo action. 00256 UndoColAct->Color = Page::GetPageColour(); 00257 00258 if (ActCode != AC_FAIL) // i.e. The ActCode = AC_OK or AC_NO_RECORD 00259 { 00260 DocColour Col ((INT32)(rand()%255), 00261 (INT32)(rand()%255), 00262 (INT32)(rand()%255)); 00263 // Give the page a random colour 00264 Page::SetPageColour(Col); 00265 // Redraw the document to see the change in the page's colour 00266 (DocView::GetSelected())->ForceRedraw(); 00267 00268 //if (IsUserName("Simon")) 00269 // TRACE( _T("Created undo action 1\n")); 00270 00271 UndoAction2* UndoAct2; 00272 00273 // Try to init a second undo action (this one will perform nothing when executed) 00274 if (UndoAction2::Init(this, 00275 &UndoActions, 00276 10, 00277 (Action**)(&UndoAct2)) != AC_FAIL) 00278 { 00279 // The Undo action was successfully initialised 00280 //if (IsUserName("Simon")) 00281 //{ 00282 // TRACE( _T("Created undo action 2\n")); 00283 //} 00284 UndoAction3* UndoAct3; 00285 00286 // Try to Init a third undo action (again this will perform nothing when executed) 00287 UndoAction3::Init(this, 00288 &UndoActions, 00289 10, 00290 (Action**)(&UndoAct3)); 00291 } 00292 } 00293 00294 #ifdef _DEBUG 00295 // Remember our working document 00296 Document *pDoc = GetWorkingDoc(); 00297 #endif 00298 00299 // End the operation 00300 End(); 00301 00302 #ifdef _DEBUG 00303 // Ensure that the size of the operation history is valid 00304 pDoc->GetOpHistory().DebugSizeCheck(); 00305 #endif 00306 #else 00307 //BitmapEffectAtom::Test2(this); 00308 TraceRegion::Test(this); 00309 // End the operation 00310 End(); 00311 00312 #endif 00313 }
|
|
For finding the BlobbyOp's state.
Definition at line 222 of file blobby.cpp. 00223 { 00224 OpState OpSt; 00225 return(OpSt); 00226 }
|
|
BlobyOp initialiser method.
Reimplemented from SimpleCCObject. Definition at line 194 of file blobby.cpp. 00195 { 00196 return (UndoableOperation::RegisterOpDescriptor( 00197 0, 00198 _R(IDS_BLOBBY_OP), 00199 CC_RUNTIME_CLASS(BlobbyOp), 00200 OPTOKEN_BLOBBY, 00201 BlobbyOp::GetState, 00202 0, /* help ID */ 00203 _R(IDBBL_BLOBBYOP), 00204 0 /* bitmap ID */)); 00205 }
|