BitmapListComponentClass Class Reference

Provide a class that will add Bitmap components to new documents. More...

#include <bmpcomp.h>

Inheritance diagram for BitmapListComponentClass:

DocComponentClass ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

BOOL AddComponent (BaseDocument *)
 Add a Bitmap list component to the specified document.

Static Public Member Functions

static BOOL Init ()
 Register the Bitmap list document component with the main application.

Detailed Description

Provide a class that will add Bitmap components to new documents.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94
See also:
DocComponentClass

Definition at line 199 of file bmpcomp.h.


Member Function Documentation

BOOL BitmapListComponentClass::AddComponent BaseDocument pDocument  )  [virtual]
 

Add a Bitmap list component to the specified document.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94
Parameters:
pDocument - the document to add the Bitmap list to. [INPUTS]
Returns:
TRUE if the Bitmap list was added ok; FALSE if not.

Errors: Out of memory

See also:
BitmapListComponentClass

Implements DocComponentClass.

Definition at line 488 of file bmpcomp.cpp.

00489 {
00490     // Check to see if this document already has a Bitmap list; if so, leave it alone.
00491     if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(BitmapListComponent)) != NULL)
00492         return TRUE;
00493 
00494     // No Bitmap list - try to create a new one for this document.
00495     BitmapList *pList = new BitmapList;
00496     if(pList == NULL)
00497         return FALSE;
00498 
00499     pList->Init(pDocument);     // Let the BitmapList know what its parent document is
00500 
00501     // Ok - create the Bitmap list component using this list.
00502     BitmapListComponent *pComponent = new BitmapListComponent(pList);
00503     if (pComponent == NULL)
00504     {
00505         // Out of memory...
00506         delete pList;
00507         return FALSE;
00508     }
00509 
00510     // All ok - add the component to the document.
00511     pDocument->AddDocComponent(pComponent);
00512     return TRUE;
00513 }

BOOL BitmapListComponentClass::Init void   )  [static]
 

Register the Bitmap list document component with the main application.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94
Returns:
TRUE if all went well; FALSE if not.

Errors: Out of memory.

See also:
DocComponent

Reimplemented from SimpleCCObject.

Definition at line 458 of file bmpcomp.cpp.

00459 {
00460     // Instantiate a component class to register with the application.
00461     BitmapListComponentClass *pClass = new BitmapListComponentClass;
00462     if (pClass == NULL)
00463         return FALSE;
00464 
00465     // Register it
00466     GetApplication()->RegisterDocComponent(pClass);
00467 
00468     // All ok
00469     return TRUE;
00470 }


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