OpDisplayFrameGallery Class Reference

Displays the frame gallery. This op can be attached to a menu, button or keypress. More...

#include <layergal.h>

Inheritance diagram for OpDisplayFrameGallery:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

void Do (OpDescriptor *)
 Displays the frame gallery.

Static Public Member Functions

static BOOL Init ()
 OpDisplayFrameGallery initialiser method.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpDisplayFrameGallery's state.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDisplayFrameGallery)

Detailed Description

Displays the frame gallery. This op can be attached to a menu, button or keypress.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/97
See also:
-

Definition at line 468 of file layergal.h.


Member Function Documentation

OpDisplayFrameGallery::CC_DECLARE_DYNCREATE OpDisplayFrameGallery   )  [private]
 

void OpDisplayFrameGallery::Do OpDescriptor  )  [virtual]
 

Displays the frame gallery.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 2049 of file layergal.cpp.

02050 {
02051     String_32 Name(_R(IDS_FRAMEGAL_GALLNAME));
02052     SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(Name);
02053 
02054     if (pSuperGallery != NULL)
02055     {
02056         if (pSuperGallery->GetRuntimeClass() == CC_RUNTIME_CLASS(FrameSGallery))
02057         {
02058             GIFAnimationPropertyTabs::SetFrameGalleryOpen(FALSE);
02059 
02060             // Toggle the visible state of the gallery window
02061             pSuperGallery->SetVisibility( !pSuperGallery->IsVisible() );
02062         }
02063         else
02064         {
02065             ERROR3("Got the frame gallery but it's not of the LayerSGallery class");
02066         }
02067 
02068         SGInit::UpdateGalleryButton(_R(OPTOKEN_DISPLAYFRAMEGALLERY), pSuperGallery->IsVisible());
02069 
02070         GIFAnimationPropertyTabs::SetFrameGalleryOpen(TRUE);
02071     }
02072 
02073     ERROR3IF(pSuperGallery == NULL,"Couldn't find the frame gallery bar");
02074 
02075     End();
02076 }

OpState OpDisplayFrameGallery::GetState String_256 UIDescription,
OpDescriptor
[static]
 

For finding the OpDisplayFrameGallery's state.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpDisplayFrameGallery operation

Errors: -

See also:
-

Definition at line 1963 of file layergal.cpp.

01964 {
01965     // The frame gallery op has been modified so that 
01966     // it can only be opened on a frame based document.
01967 
01968     OpState OpSt;
01969 
01970 #ifdef WEBSTER
01971         
01972     // If the gallery is currenty open, then the menu item should be ticked
01973     SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(_R(IDD_LAYERSGALLERY));
01974 
01975     if (pSuperGallery != NULL)
01976     {
01977         if (pSuperGallery->GetRuntimeClass() == CC_RUNTIME_CLASS(FrameSGallery))
01978             OpSt.Ticked = pSuperGallery->IsVisible();
01979     }
01980 
01981     // If there are no open documents, you can't toggle the gallery
01982     OpSt.Greyed = (Document::GetSelected() == NULL);
01983 
01984 #else
01985 
01986     // Flag variables.
01987     BOOL FramedDoc = FALSE;     // Flag to determine whether this is a framelayer(animation) document.
01988 
01989     // Get a ptr to the selected spread
01990     Spread* pSpread = Document::GetSelectedSpread();
01991 
01992     // Ensure a valid spread ptr.
01993     if(pSpread)
01994     {
01995         // Are there any frame layers?
01996         Layer* pFrameLayer = pSpread->FindFirstFrameLayer();    
01997 
01998         //If a frame layer exists, then this is an animation doc.
01999         if (pFrameLayer)
02000             FramedDoc = TRUE;
02001     }
02002 
02003     // If this is an animation Doc, then set the correct menu item state.
02004     if(FramedDoc)
02005     {
02006         // If the gallery is currenty open, then the menu item should be ticked
02007         String_32 Name(_R(IDS_FRAMEGAL_GALLNAME));
02008         SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(Name);
02009 
02010         if (pSuperGallery != NULL)
02011         {
02012             if (pSuperGallery->GetRuntimeClass() == CC_RUNTIME_CLASS(FrameSGallery))
02013                 OpSt.Ticked = pSuperGallery->IsVisible();
02014         }
02015 
02016         // If there are no open documents, you can't toggle the gallery
02017         OpSt.Greyed = (Document::GetSelected() == NULL);
02018     }
02019     else
02020     {
02021         // This is a layer document, so the Frame Gallery isn't needed.
02022         //  Set up item up as greyed and give a reason.
02023         OpSt.Ticked = FALSE;
02024         OpSt.Greyed = TRUE;
02025         *UIDescription = String_256 (_R(IDS_NO_FRAMES));
02026     }
02027 
02028 #endif
02029 
02030     // Lets go back..
02031     return(OpSt);   
02032 }

BOOL OpDisplayFrameGallery::Init void   )  [static]
 

OpDisplayFrameGallery initialiser method.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1935 of file layergal.cpp.

01936 {
01937     return (RegisterOpDescriptor(
01938                                 0,
01939                                 _R(IDS_DISPLAY_FRAME_GALLERY),
01940                                 CC_RUNTIME_CLASS(OpDisplayFrameGallery),
01941                                 OPTOKEN_DISPLAYFRAMEGALLERY,
01942                                 OpDisplayFrameGallery::GetState,
01943                                 _R(IDH_Gallery_Frame),  /* help ID */
01944                                 _R(IDBBL_DISPLAY_FRAME_GALLERY),
01945                                 0   /* bitmap ID */));
01946 }               


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:57:57 2007 for Camelot by  doxygen 1.4.4