OpDisplayLibClipartGallery Class Reference

#include <sglcart.h>

Inheritance diagram for OpDisplayLibClipartGallery:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

void Do (OpDescriptor *)
 Displays the LibCliparts gallery Updates the button state for this Op (the button sticks down while the gallery is open).

Static Public Member Functions

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

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDisplayLibClipartGallery)

Static Private Member Functions

static DialogBarOpFindGallery (void)
 Finds the LibClipart gallery class instance.

Detailed Description

Definition at line 352 of file sglcart.h.


Member Function Documentation

OpDisplayLibClipartGallery::CC_DECLARE_DYNCREATE OpDisplayLibClipartGallery   )  [private]
 

void OpDisplayLibClipartGallery::Do OpDescriptor  )  [virtual]
 

Displays the LibCliparts gallery Updates the button state for this Op (the button sticks down while the gallery is open).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/95 (base generated in sgbase.cpp)
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 2504 of file sglcart.cpp.

02505 {
02506     TRACEUSER( "Matt", _T("OpDisplayLibClipartGallery::Do called\n"));
02507     DialogBarOp *pDialogBarOp = FindGallery();
02508 
02509     if (pDialogBarOp != NULL)
02510     {
02511         // Toggle the visible state of the gallery window
02512         pDialogBarOp->SetVisibility( !pDialogBarOp->IsVisible() );
02513 
02514         // And update our button state
02515         SGInit::UpdateGalleryButton(OPTOKEN_DISPLAYCLIPARTGALLERY, pDialogBarOp->IsVisible());
02516 
02517         // If we're closing the gallery, flush the thumbnail caches
02518         if(pDialogBarOp->IsVisible() == FALSE)
02519         {
02520             // Flush the thumbnail cache
02521             BROADCAST_TO_CLASS(ThumbMessage(ThumbMessage::ThumbState::KILLCACHE, SGLib_ClipArt), DialogOp);
02522             BROADCAST_TO_CLASS(ThumbMessage(ThumbMessage::ThumbState::KILLCACHE, SGLib_ClipArt_WebThemes), DialogOp);
02523             BROADCAST_TO_CLASS(ThumbMessage(ThumbMessage::ThumbState::KILLCACHE, SGLib_Bitmap), DialogOp);
02524 
02525             // Ensure all open libraries are closed and memory reclaimed when the gallery closes
02526             if(LibClipartSGallery::ThisGallery != NULL)
02527             {
02528                 LibClipartSGallery::ThisGallery->GalleryAboutToClose();
02529             }
02530             else
02531             {
02532                 ERROR3("Clipart gallery seems to have been closed before I could reclaim my memory");
02533             }
02534 
02535         }
02536 /*      else
02537         {
02538             if(LibClipartSGallery::ThisGallery != NULL)
02539             {
02540                 LibClipartSGallery::ThisGallery->GalleryAboutToReOpen();
02541             }
02542         }*/
02543     }
02544 
02545     End();
02546 }

DialogBarOp * OpDisplayLibClipartGallery::FindGallery void   )  [static, private]
 

Finds the LibClipart gallery class instance.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/95 (base generated in sgbase.cpp)
Returns:
NULL or a pointer to the LibClipart gallery instance
Notes: The bars system always keeps one LibClipart gallery alive for us. If one is not found, this usually indicates that it can't be found in bars.ini: Check that the 'Name' string *exactly* matches the title string given in bars.ini. Also check that bars.ini indicates the bar is of the LibClipartSGallery class

Definition at line 2569 of file sglcart.cpp.

02570 {
02571     String_32 Name = _R(IDS_SGLCART_GALLERY_NAME); // "Clipart gallery";
02572     DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(Name);
02573 
02574     if (pDialogBarOp != NULL)
02575     {
02576         if (pDialogBarOp->GetRuntimeClass() == CC_RUNTIME_CLASS(LibClipartSGallery))
02577             return(pDialogBarOp);
02578 
02579         ERROR3("Got the Clipart gallery but it's not of the LibClipartSGallery class");
02580     }
02581     else
02582     {
02583         ERROR3("Can't find the Clipart gallery in bars.ini!\n");
02584     }
02585 
02586     return(NULL);
02587 }

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

For finding the OpDisplayLibClipartGallery's state.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/95 (base generated in sgbase.cpp)
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpDisplayLibClipartGallery operation

Errors: -

See also:
-

Definition at line 2472 of file sglcart.cpp.

02473 {
02474     OpState OpSt;  
02475 
02476     // If the gallery is currenty open, then the menu item should be ticked
02477     DialogBarOp* pDialogBarOp = FindGallery();
02478     if (pDialogBarOp != NULL)
02479         OpSt.Ticked = pDialogBarOp->IsVisible();
02480 
02481 //  OpSt.Greyed = (Document::GetSelected() == NULL);
02482     return(OpSt);   
02483 }

BOOL OpDisplayLibClipartGallery::Init void   )  [static]
 

OpDisplayLibClipartGallery initialiser method.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/2/95 (base generated in sgbase.cpp)
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 2441 of file sglcart.cpp.

02442 {
02443 
02444     ERRORIF(new OpLibGalClipTheme == 0, _R(IDE_NOMORE_MEMORY), FALSE);
02445 
02446     return (RegisterOpDescriptor(
02447                                 0,
02448                                 _R(IDS_DISPLAY_CLIPART_GALLERY),
02449                                 CC_RUNTIME_CLASS(OpDisplayLibClipartGallery),
02450                                 OPTOKEN_DISPLAYCLIPARTGALLERY,
02451                                 OpDisplayLibClipartGallery::GetState,
02452                                 0,  /* help ID */
02453                                 _R(IDBBL_DISPLAY_CLIPART_GALLERY),
02454                                 0   /* bitmap ID */));
02455 }               


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