#include <sglcart.h>
Inheritance diagram for OpDisplayLibClipartGallery:
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 DialogBarOp * | FindGallery (void) |
Finds the LibClipart gallery class instance. |
Definition at line 352 of file sglcart.h.
|
|
|
Displays the LibCliparts gallery Updates the button state for this Op (the button sticks down while the gallery is open).
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 }
|
|
Finds the LibClipart gallery class instance.
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 }
|
|
For finding the OpDisplayLibClipartGallery's state.
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 }
|
|
OpDisplayLibClipartGallery initialiser method.
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 }
|