BfxPlugInContextMenu Class Reference

Implements the Bfx plug-ins context sensitive menus. More...

#include <bfxop.h>

Inheritance diagram for BfxPlugInContextMenu:

PlugInsContextMenu ContextMenu List of all members.

Public Member Functions

 BfxPlugInContextMenu (KernelBitmap *pBitmap, Document *pDocument)
 Default constructer.
virtual BOOL Build ()
 To build the Bfx plug-ins pop-up menu.

Static Public Member Functions

static BOOL BuildMenu (KernelBitmap *pBitmap, Document *pDocument, ContextMenu *pContextMenu, MenuItem *pMainRoot=NULL, BOOL AddSeparator=FALSE, BOOL UseUndoable=FALSE)
 To build the a Bfx plug-ins pop-up menu either directly or tacked on as a sub-menu item to the specified pMainRoot.

Protected Attributes

KernelBitmapm_pBitmap
Documentm_pDocument

Private Member Functions

 CC_DECLARE_MEMDUMP (BfxPlugInContextMenu)

Detailed Description

Implements the Bfx plug-ins context sensitive menus.

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

Definition at line 155 of file bfxop.h.


Constructor & Destructor Documentation

BfxPlugInContextMenu::BfxPlugInContextMenu KernelBitmap pBitmap,
Document pDocument
 

Default constructer.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
pBitmap the bitmap to apply the effect to [INPUTS] pDocument the document the bitmap is stored in
- [OUTPUTS]

Definition at line 376 of file bfxop.cpp.

00377 {
00378     BfxPlugInOp::SetBitmapAndDocument(pBitmap, pDocument);
00379     
00380     // remember them for later use
00381     m_pBitmap = pBitmap;
00382     m_pDocument = pDocument;
00383 
00384 }


Member Function Documentation

BOOL BfxPlugInContextMenu::Build void   )  [virtual]
 

To build the Bfx plug-ins pop-up menu.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Returns:
TRUE if menu built OK FALSE (and sets error) otherwise

Reimplemented from PlugInsContextMenu.

Definition at line 398 of file bfxop.cpp.

00399 {
00400     return BfxPlugInContextMenu::BuildMenu(m_pBitmap, m_pDocument, this);
00401 }

BOOL BfxPlugInContextMenu::BuildMenu KernelBitmap pBitmap,
Document pDocument,
ContextMenu pContextMenu,
MenuItem pMainRoot = NULL,
BOOL  AddSeparator = FALSE,
BOOL  UseUndoable = FALSE
[static]
 

To build the a Bfx plug-ins pop-up menu either directly or tacked on as a sub-menu item to the specified pMainRoot.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
pBitmap bitmap the effect is to be applied to [INPUTS] pDocument the document the bitmap is in pContextMenu the menu we want to add to pMainRoot the root menu to add this menu to, defaults to no parent AddSeparator True if want a separator added to the last item on the menu UseUndoable True if want the undoable operations instead of the non-undoable Defaults to False
Returns:
TRUE if menu built OK FALSE (and sets error) otherwise

Reimplemented from PlugInsContextMenu.

Definition at line 425 of file bfxop.cpp.

00428 {
00429     ERROR2IF(pContextMenu == NULL,FALSE,"BfxPlugInContextMenu::BuildMenu null ContextMenu to add to");
00430 
00431     // Inform the Bfx operation what bitmap and document it will be working on
00432     BfxPlugInOp::SetBitmapAndDocument(pBitmap, pDocument);
00433 
00434     BOOL ok = TRUE;
00435     // In the non-undoable case we require the bitmap and document pointers.
00436     // In the undoable case these will be null.
00437     if ((pBitmap != NULL && pDocument != NULL) || UseUndoable)
00438     {
00439         //ok = ok && pContextMenu->BuildCommand(OPTOKEN_Bfx_APPLYLAST, TRUE, pMainRoot);
00440 
00441         PlugInManager* pManager = GetApplication()->GetPlugInManager();
00442         if (pManager != NULL)
00443         {
00444             String_32 OpToken;
00445             String_32 FamilyOpToken;
00446             String_32 LastFamilyOpToken;
00447             MenuItem* pFamilyRoot = NULL;
00448             // Add the unique undo signature
00449             String_32 UndoSig(TEXT(PLUGIN_UNDO_SIG));
00450             // Go through the list of plug-ins registered to the system and make up a
00451             // menu structure from the OpTokens that they have registered.
00452             // Assumes the plug-ins are sorted correctly on family names and then
00453             // plug-in names.
00454             PlugInItem * pPlugIn = pManager->GetFirstPlugIn();
00455             while (pPlugIn)
00456             {
00457                 // Only allow Bfx plug-ins on this menu. We are very plug-inist!
00458                 if (pPlugIn->GetTypeOfPlugIn() == PLUGIN_BFX)
00459                 {
00460                     OpToken = pPlugIn->GetUniqueID();
00461                     if (UseUndoable)
00462                         OpToken += UndoSig;
00463                     FamilyOpToken = OpToken;
00464                     OpToken += pPlugIn->GetPlugInName();
00465                     FamilyOpToken += pPlugIn->GetFamilyName();
00466                     // check if we already have 
00467 //                  if (FamilyOpToken != LastFamilyOpToken)
00468 //                  {
00469 //                      ok = ok && pContextMenu->BuildCommand(FamilyOpToken, FALSE, pMainRoot);
00470 //                      pFamilyRoot = pContextMenu->GetLastItem();
00471 //                  }
00472 //                  ok = ok && pContextMenu->BuildCommand(OpToken, FALSE, pFamilyRoot);
00473                     ok = ok && pContextMenu->BuildCommand(OpToken, FALSE, pMainRoot);
00474 
00475                     LastFamilyOpToken = FamilyOpToken;
00476                 }
00477 
00478                 // Go to the next plug-in in the list
00479                 pPlugIn = pManager->GetNextPlugIn(pPlugIn);
00480             }
00481 
00482             // Tell the last item that it should have a separator 
00483             if (pFamilyRoot != NULL && AddSeparator)
00484                 pFamilyRoot->SetIsFollowedBySeparator(TRUE);
00485         }
00486     }
00487     
00488     return ok;
00489 }

BfxPlugInContextMenu::CC_DECLARE_MEMDUMP BfxPlugInContextMenu   )  [private]
 


Member Data Documentation

KernelBitmap* BfxPlugInContextMenu::m_pBitmap [protected]
 

Reimplemented from PlugInsContextMenu.

Definition at line 172 of file bfxop.h.

Document* BfxPlugInContextMenu::m_pDocument [protected]
 

Reimplemented from PlugInsContextMenu.

Definition at line 173 of file bfxop.h.


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