#include <infocomp.h>
Inheritance diagram for DocInfoComponentClass:
Public Member Functions | |
BOOL | AddComponent (BaseDocument *) |
Add a unit list component to the specified document. | |
Static Public Member Functions | |
static BOOL | Init () |
Register the unit list document component with the main application. |
Definition at line 120 of file infocomp.h.
|
Add a unit list component to the specified document.
Implements DocComponentClass. Definition at line 179 of file infocomp.cpp. 00180 { 00181 // Check to see if this document already has a colour list; if so, leave it alone. 00182 if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(DocInfoComponent)) != NULL) 00183 return TRUE; 00184 00185 // Ok - create the colour list component using this list. 00186 DocInfoComponent *pComponent = new DocInfoComponent(); 00187 if (pComponent == NULL) 00188 { 00189 // Out of memory... 00190 return FALSE; 00191 } 00192 00193 // All ok - add the component to the document. 00194 pDocument->AddDocComponent(pComponent); 00195 return TRUE; 00196 }
|
|
Register the unit list document component with the main application.
Reimplemented from SimpleCCObject. Definition at line 149 of file infocomp.cpp. 00150 { 00151 // Instantiate a component class to register with the application. 00152 DocInfoComponentClass *pClass = new DocInfoComponentClass; 00153 if (pClass == NULL) 00154 return FALSE; 00155 00156 // Register it 00157 GetApplication()->RegisterDocComponent(pClass); 00158 00159 // All ok 00160 return TRUE; 00161 }
|