#include <unitcomp.h>
Inheritance diagram for UnitListComponentClass:
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 unitcomp.h.
|
Add a unit list component to the specified document.
Implements DocComponentClass. Definition at line 183 of file unitcomp.cpp. 00184 { 00185 // Check to see if this document already has a colour list; if so, leave it alone. 00186 if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(UnitListComponent)) != NULL) 00187 return TRUE; 00188 00189 // Ok - create the colour list component using this list. 00190 UnitListComponent *pComponent = new UnitListComponent(); 00191 if (pComponent == NULL) 00192 { 00193 // Out of memory... 00194 return FALSE; 00195 } 00196 00197 // All ok - add the component to the document. 00198 pDocument->AddDocComponent(pComponent); 00199 return TRUE; 00200 }
|
|
Register the unit list document component with the main application.
Reimplemented from SimpleCCObject. Definition at line 153 of file unitcomp.cpp. 00154 { 00155 // Instantiate a component class to register with the application. 00156 UnitListComponentClass *pClass = new UnitListComponentClass; 00157 if (pClass == NULL) 00158 return FALSE; 00159 00160 // Register it 00161 GetApplication()->RegisterDocComponent(pClass); 00162 00163 // All ok 00164 return TRUE; 00165 }
|