#include <bmpcomp.h>
Inheritance diagram for BitmapListComponentClass:
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. |
Definition at line 199 of file bmpcomp.h.
|
Add a Bitmap list component to the specified document.
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 }
|
|
Register the Bitmap list document component with the main application.
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 }
|