OpDisplayLibFillsGallery Class Reference

#include <sglfills.h>

Inheritance diagram for OpDisplayLibFillsGallery:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

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

Static Public Member Functions

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

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDisplayLibFillsGallery)

Static Private Member Functions

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

Detailed Description

Definition at line 274 of file sglfills.h.


Member Function Documentation

OpDisplayLibFillsGallery::CC_DECLARE_DYNCREATE OpDisplayLibFillsGallery   )  [private]
 

void OpDisplayLibFillsGallery::Do OpDescriptor  )  [virtual]
 

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

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 1641 of file sglfills.cpp.

01642 {
01643     DialogBarOp *pDialogBarOp = FindGallery();
01644 
01645     if (pDialogBarOp != NULL)
01646     {
01647         // Toggle the visible state of the gallery window
01648         pDialogBarOp->SetVisibility( !pDialogBarOp->IsVisible() );
01649 
01650         // And update our button state
01651         SGInit::UpdateGalleryButton(OPTOKEN_DISPLAYFILLSGALLERY, pDialogBarOp->IsVisible());
01652 
01653         // If we're closing the gallery, flush the thumbnail caches
01654         if(pDialogBarOp->IsVisible() == FALSE)
01655         {
01656             // Flush the thumbnail cache
01657             BROADCAST_TO_CLASS(ThumbMessage(ThumbMessage::ThumbState::KILLCACHE, SGLib_Texture), DialogOp);
01658             BROADCAST_TO_CLASS(ThumbMessage(ThumbMessage::ThumbState::KILLCACHE, SGLib_Fractal), DialogOp);
01659 
01660             // Ensure all open libraries are closed and memory reclaimed when the gallery closes
01661             if(LibFillsSGallery::ThisGallery != NULL)
01662             {
01663                 // Free memory, etc...
01664                 LibFillsSGallery::ThisGallery->GalleryAboutToClose();
01665             }
01666             
01667         }
01668     }
01669 
01670     End();
01671 }

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

Finds the LibFills gallery class instance.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Returns:
NULL or a pointer to the LibFills gallery instance
Notes: The bars system always keeps one LibFills 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 LibFillsSGallery class

Definition at line 1693 of file sglfills.cpp.

01694 {
01695     String_32 Name = _R(IDS_SGLFILLS_GALLERY_NAME); //  "Fill gallery"
01696     DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(Name);
01697 
01698     if (pDialogBarOp != NULL)
01699     {
01700         if (pDialogBarOp->GetRuntimeClass() == CC_RUNTIME_CLASS(LibFillsSGallery))
01701             return(pDialogBarOp);
01702 
01703         ERROR3("Got the Fills gallery but it's not of the LibFillsSGallery class");
01704     }
01705     else
01706     {
01707         ERROR3("Can't find the Fills gallery in bars.ini!\n");
01708     }
01709 
01710     return(NULL);
01711 }

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

For finding the OpDisplayLibFillsGallery's state.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpDisplayLibFillsGallery operation

Errors: -

See also:
-

Definition at line 1609 of file sglfills.cpp.

01610 {
01611     OpState OpSt;  
01612 
01613     // If the gallery is currenty open, then the menu item should be ticked
01614     DialogBarOp* pDialogBarOp = FindGallery();
01615     if (pDialogBarOp != NULL)
01616         OpSt.Ticked = pDialogBarOp->IsVisible();
01617 
01618 //  OpSt.Greyed = (Document::GetSelected() == NULL);
01619     return(OpSt);   
01620 }

BOOL OpDisplayLibFillsGallery::Init void   )  [static]
 

OpDisplayLibFillsGallery initialiser method.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/95
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 1576 of file sglfills.cpp.

01577 {
01578 
01579     // **** TO DO ****
01580     // Ensure the IDS_ OPTOKEN_ and IDBBL_ constants are available and correct
01581     // You should really also uppercase these constant names.
01582 
01583     return (RegisterOpDescriptor(
01584                                 0,
01585                                 _R(IDS_DISPLAY_FILLS_GALLERY),
01586                                 CC_RUNTIME_CLASS(OpDisplayLibFillsGallery),
01587                                 OPTOKEN_DISPLAYFILLSGALLERY,
01588                                 OpDisplayLibFillsGallery::GetState,
01589                                 0,  /* help ID */
01590                                 _R(IDBBL_DISPLAY_FILLS_GALLERY),
01591                                 0   /* bitmap ID */));
01592 }               


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