#include <frameops.h>
Inheritance diagram for OpSelectPrevFrame:
Public Member Functions | |
OpSelectPrevFrame () | |
void | Do (OpDescriptor *pOpDesc) |
Tries to select the previous animation frame (i.e. layer). | |
Static Public Member Functions | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpSelectPrevFrame's state. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpSelectPrevFrame) |
Definition at line 182 of file frameops.h.
|
Definition at line 187 of file frameops.h.
|
|
|
|
Tries to select the previous animation frame (i.e. layer).
Reimplemented from Operation. Definition at line 504 of file frameops.cpp. 00505 { 00506 // Just find the background layer and then ask our baseclass to delete it for us 00507 // Is there a selected spread? 00508 Spread * pSpread = Document::GetSelectedSpread(); 00509 if (pSpread) 00510 { 00511 PORTNOTE("other", "Disabled FrameSGallery") 00512 #ifndef EXCLUDE_FROM_XARALX 00513 // Check that all visible layers are actually frame layers 00514 FrameSGallery::EnsureFrameLayerIntegrity(pSpread); 00515 #endif 00516 // yes, so find the last layer and try to move to it 00517 Layer * pLayer = pSpread->FindActiveLayer(); 00518 Layer * pPrevLayer = NULL; 00519 if (pLayer) 00520 pPrevLayer = pLayer->FindPrevFrameLayer(); 00521 if (pPrevLayer) 00522 { 00523 OpLayerGalParam Param(FRAME_SELECT, pSpread); 00524 Param.pLayer = pPrevLayer; 00525 DoWithParam(pOpDesc, (OpParam*)&Param); 00526 } 00527 } 00528 00529 // End the operation, but we are calling DoWithParam() which we will assume does it for us. 00530 //End(); 00531 00532 return; 00533 }
|
|
For finding the OpSelectPrevFrame's state.
Reimplemented from OpLayerGalChange. Definition at line 402 of file frameops.cpp. 00403 { 00404 //The frame movement controls on the GIF animation bar now work on frames only. 00405 OpState OpSt; 00406 00407 #ifdef WEBSTER 00408 00409 // Is there a selected spread? 00410 Spread * pSpread = Document::GetSelectedSpread(); 00411 if (pSpread) 00412 { 00413 // yes, so check if there is an active layer 00414 Layer * pLayer = pSpread->FindActiveLayer(); 00415 // If there is an active layer and one preceeding then we are not greyed 00416 Layer * pPrevLayer = pLayer->FindPrevLayer(); 00417 // The previous layer should really be a frame layer but we cannot guarantee that but 00418 // it mustn't be a guide, a page background or a background layer. 00419 while ( pPrevLayer && !pPrevLayer->IsPseudoFrame()) 00420 { 00421 pPrevLayer = pPrevLayer->FindPrevLayer(); 00422 } 00423 00424 if (pLayer && pPrevLayer) 00425 { 00426 // Yes, so we are allowed to move to the previous one 00427 OpSt.Greyed = FALSE; 00428 } 00429 else 00430 { 00431 // No, so we are greyed 00432 OpSt.Greyed = TRUE; 00433 } 00434 } 00435 else 00436 { 00437 // No selected spread, so we are greyed 00438 OpSt.Greyed = TRUE; 00439 } 00440 00441 #else 00442 // Are we in frame mode. 00443 BOOL FrameMode = IsFrameMode(); 00444 00445 if(FrameMode) 00446 { 00447 // Is there a selected spread? 00448 Spread * pSpread = Document::GetSelectedSpread(); 00449 if (pSpread) 00450 { 00451 // yes, so check if there is an active layer 00452 Layer * pLayer = pSpread->FindActiveLayer(); 00453 // If there is an active layer and one preceeding then we are not greyed 00454 Layer * pPrevLayer = pLayer->FindPrevLayer(); 00455 // The previous layer should really be a frame layer but we cannot guarantee that but 00456 // it mustn't be a guide, a page background or a background layer. 00457 while ( pPrevLayer && !pPrevLayer->IsPseudoFrame()) 00458 { 00459 pPrevLayer = pPrevLayer->FindPrevLayer(); 00460 } 00461 00462 if (pLayer && pPrevLayer) 00463 { 00464 // Yes, so we are allowed to move to the previous one 00465 OpSt.Greyed = FALSE; 00466 } 00467 else 00468 { 00469 // No, so we are greyed 00470 OpSt.Greyed = TRUE; 00471 } 00472 } 00473 else 00474 { 00475 // No selected spread, so we are greyed 00476 OpSt.Greyed = TRUE; 00477 } 00478 } 00479 else 00480 { 00481 // The document is layer based, so we are greyed. 00482 OpSt.Greyed = TRUE; 00483 } 00484 #endif 00485 00486 return OpSt; 00487 }
|