#include <layergal.h>
Inheritance diagram for OpDisplayLayerGallery:
Public Member Functions | |
void | Do (OpDescriptor *) |
Displays the layers gallery. | |
Static Public Member Functions | |
static BOOL | Init () |
OpDisplayLayerGallery initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpDisplayLayerGallery's state. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpDisplayLayerGallery) |
Definition at line 437 of file layergal.h.
|
|
|
Displays the layers gallery.
Reimplemented from Operation. Definition at line 1882 of file layergal.cpp. 01883 { 01884 SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(_R(IDD_LAYERSGALLERY)); 01885 01886 if (!pSuperGallery) pSuperGallery = new LayerSGallery; 01887 01888 if (pSuperGallery != NULL) 01889 { 01890 if (pSuperGallery->GetRuntimeClass() == CC_RUNTIME_CLASS(LayerSGallery)) 01891 { 01892 // Toggle the visible state of the gallery window 01893 pSuperGallery->SetVisibility( !pSuperGallery->IsVisible() ); 01894 } 01895 else 01896 { 01897 ERROR3("Got the layer gallery but it's not of the LayerSGallery class"); 01898 } 01899 01900 SGInit::UpdateGalleryButton(_R(OPTOKEN_DISPLAYLAYERGALLERY), pSuperGallery->IsVisible()); 01901 } 01902 01903 ERROR3IF(pSuperGallery == NULL,"Couldn't find the layer gallery bar"); 01904 01905 End(); 01906 }
|
|
For finding the OpDisplayLayerGallery's state.
Definition at line 1818 of file layergal.cpp. 01819 { 01820 // The Layer gallery op has been modified so that 01821 // it can only be opened on a layer based document. 01822 01823 OpState OpSt; 01824 01825 // Flag variables. 01826 BOOL LayerDoc = TRUE; // Flag to determine whether this is a layer document. 01827 01828 // Get a ptr to the selected spread 01829 Spread* pSpread = Document::GetSelectedSpread(); 01830 01831 // Ensure a valid spread ptr. 01832 if(pSpread) 01833 { 01834 // Are there any frame layers? 01835 Layer* pFrameLayer = pSpread->FindFirstFrameLayer(); 01836 01837 //If a frame layer exists, then this is an animation doc. 01838 if (pFrameLayer) 01839 LayerDoc = FALSE; 01840 } 01841 01842 if(LayerDoc) 01843 { 01844 // If the gallery is currenty open, then the menu item should be ticked 01845 SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(_R(IDD_LAYERSGALLERY)); 01846 01847 if (pSuperGallery != NULL) 01848 { 01849 if (pSuperGallery->GetRuntimeClass() == CC_RUNTIME_CLASS(LayerSGallery)) 01850 OpSt.Ticked = pSuperGallery->IsVisible(); 01851 } 01852 01853 // If there are no open documents, you can't toggle the gallery 01854 OpSt.Greyed = (Document::GetSelected() == NULL); 01855 } 01856 else 01857 { 01858 // This is a frame document, so set the menu item to the correct state. 01859 OpSt.Ticked = FALSE; 01860 OpSt.Greyed = TRUE; 01861 *UIDescription = String_256 (_R(IDS_NO_LAYERS)); 01862 } 01863 01864 return(OpSt); 01865 }
|
|
OpDisplayLayerGallery initialiser method.
Reimplemented from SimpleCCObject. Definition at line 1779 of file layergal.cpp. 01780 { 01781 return (RegisterOpDescriptor( 01782 0, 01783 _R(IDS_DISPLAY_LAYER_GALLERY), 01784 CC_RUNTIME_CLASS(OpDisplayLayerGallery), 01785 OPTOKEN_DISPLAYLAYERGALLERY, 01786 OpDisplayLayerGallery::GetState, 01787 0, /* help ID */ 01788 _R(IDBBL_DISPLAY_LAYER_GALLERY), 01789 _R(IDC_BTN_SGLAYER), // UINT32 resourceID = 0, // resource ID 01790 _R(IDC_BTN_SGLAYER), // UINT32 controlID = 0, // control ID 01791 SYSTEMBAR_ILLEGAL, // SystemBarType GroupBarID = SYSTEMBAR_ILLEGAL, // group bar ID 01792 TRUE, // BOOL ReceiveMessages = TRUE, // BODGE 01793 FALSE, // BOOL Smart = FALSE, 01794 TRUE, // BOOL Clean = TRUE, 01795 NULL, // OpDescriptor *pVertOpDesc = NULL, 01796 0, // UINT32 OneOpenInstID = 0, 01797 0, // UINT32 AutoStateFlags = 0, 01798 TRUE // BOOL fCheckable = FALSE 01799 ) 01800 ); 01801 }
|