#include <frameops.h>
Inheritance diagram for OpSelectNextFrame:
Public Member Functions | |
OpSelectNextFrame () | |
void | Do (OpDescriptor *pOpDesc) |
Tries to select the next animation frame (i.e. layer). | |
Static Public Member Functions | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpSelectNextFrame's state. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpSelectNextFrame) |
Definition at line 206 of file frameops.h.
|
Definition at line 211 of file frameops.h.
|
|
|
|
Tries to select the next animation frame (i.e. layer).
Reimplemented from Operation. Definition at line 661 of file frameops.cpp. 00662 { 00663 // Just find the background layer and then ask our baseclass to delete it for us 00664 // Is there a selected spread? 00665 Spread * pSpread = Document::GetSelectedSpread(); 00666 if (pSpread) 00667 { 00668 PORTNOTE("other", "Disabled BrowserPreviewOptions") 00669 #ifndef EXCLUDE_FROM_XARALX 00670 // Check that all visible layers are actually frame layers 00671 FrameSGallery::EnsureFrameLayerIntegrity(pSpread); 00672 #endif 00673 // yes, so find the next layer and try to move to it 00674 Layer * pLayer = pSpread->FindActiveLayer(); 00675 Layer * pNextLayer = NULL; 00676 if (pLayer) 00677 pNextLayer = pLayer->FindNextFrameLayer(); 00678 if (pNextLayer) 00679 { 00680 OpLayerGalParam Param(FRAME_SELECT, pSpread); 00681 Param.pLayer = pNextLayer; 00682 DoWithParam(pOpDesc, (OpParam*)&Param); 00683 } 00684 } 00685 00686 // End the operation, but we are calling DoWithParam() which we will assume does it for us. 00687 //End(); 00688 00689 return; 00690 }
|
|
For finding the OpSelectNextFrame's state.
Reimplemented from OpLayerGalChange. Definition at line 558 of file frameops.cpp. 00559 { 00560 //The frame movement controls on the GIF animation bar now work on frames only. 00561 00562 OpState OpSt; 00563 00564 #ifdef WEBSTER 00565 00566 // Is there a selected spread? 00567 Spread * pSpread = Document::GetSelectedSpread(); 00568 if (pSpread) 00569 { 00570 // yes, so check if there is an active layer 00571 Layer * pLayer = pSpread->FindActiveLayer(); 00572 // If there is an active layer and one following then we are not greyed 00573 Layer * pNextLayer = pLayer->FindNextLayer(); 00574 // The next layer should really be a frame layer but we cannot guarantee that but 00575 // it mustn't be a guide, a page background or a background layer. 00576 while ( pNextLayer && !pNextLayer->IsPseudoFrame()) 00577 { 00578 pNextLayer = pNextLayer->FindNextLayer(); 00579 } 00580 00581 if (pLayer && pNextLayer) 00582 { 00583 // Yes, so we are allowed to move to the previous one 00584 OpSt.Greyed = FALSE; 00585 } 00586 else 00587 { 00588 // No, so we are greyed 00589 OpSt.Greyed = TRUE; 00590 } 00591 } 00592 else 00593 { 00594 // No selected spread, so we are greyed 00595 OpSt.Greyed = TRUE; 00596 } 00597 00598 #else 00599 // Are we in frame mode. 00600 BOOL FrameMode = IsFrameMode(); 00601 00602 if(FrameMode) 00603 { 00604 // Is there a selected spread? 00605 Spread * pSpread = Document::GetSelectedSpread(); 00606 if (pSpread) 00607 { 00608 // yes, so check if there is an active layer 00609 Layer * pLayer = pSpread->FindActiveLayer(); 00610 // If there is an active layer and one following then we are not greyed 00611 Layer * pNextLayer = pLayer->FindNextLayer(); 00612 // The next layer should really be a frame layer but we cannot guarantee that but 00613 // it mustn't be a guide, a page background or a background layer. 00614 while ( pNextLayer && !pNextLayer->IsPseudoFrame()) 00615 { 00616 pNextLayer = pNextLayer->FindNextLayer(); 00617 } 00618 00619 if (pLayer && pNextLayer) 00620 { 00621 // Yes, so we are allowed to move to the previous one 00622 OpSt.Greyed = FALSE; 00623 } 00624 else 00625 { 00626 // No, so we are greyed 00627 OpSt.Greyed = TRUE; 00628 } 00629 } 00630 else 00631 { 00632 // No selected spread, so we are greyed 00633 OpSt.Greyed = TRUE; 00634 } 00635 } 00636 else 00637 { 00638 // The document is layer based, so we are greyed. 00639 OpSt.Greyed = TRUE; 00640 } 00641 #endif 00642 00643 return OpSt; 00644 }
|