#include <viewcomp.h>
Inheritance diagram for ViewComponentClass:
Public Member Functions | |
BOOL | AddComponent (BaseDocument *) |
Add a view component to the specified document. | |
Static Public Member Functions | |
static BOOL | Init () |
Register the view document component with the main application. |
Definition at line 120 of file viewcomp.h.
|
Add a view component to the specified document.
Implements DocComponentClass. Definition at line 186 of file viewcomp.cpp. 00187 { 00188 // Check to see if this document already has a view component; if so, leave it alone. 00189 if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(ViewComponent)) != NULL) 00190 return TRUE; 00191 00192 // No view component - try to create a new one for this document. 00193 00194 // create the view component 00195 ViewComponent *pComponent = new ViewComponent; 00196 00197 // All ok - add the component to the document. 00198 pDocument->AddDocComponent(pComponent); 00199 00200 return TRUE; 00201 }
|
|
Register the view document component with the main application.
Reimplemented from SimpleCCObject. Definition at line 156 of file viewcomp.cpp. 00157 { 00158 // Instantiate a component class to register with the application. 00159 ViewComponentClass *pClass = new ViewComponentClass; 00160 if (pClass == NULL) 00161 return FALSE; 00162 00163 // Register it 00164 GetApplication()->RegisterDocComponent(pClass); 00165 00166 // All ok 00167 return TRUE; 00168 }
|