#include <fontcomp.h>
Inheritance diagram for FontComponentClass:
Public Member Functions | |
BOOL | AddComponent (BaseDocument *pDoc) |
Adds a font component to the specified document See Also: class FontComponent. | |
Static Public Member Functions | |
static BOOL | Init () |
Registers the font component with the main application See Also: class DocComponentClass. |
Definition at line 123 of file fontcomp.h.
|
Adds a font component to the specified document See Also: class FontComponent.
Implements DocComponentClass. Definition at line 294 of file fontcomp.cpp. 00295 { 00296 // check to see if this document already has a font component, if so we leave it alone 00297 if (pDoc->GetDocComponent(CC_RUNTIME_CLASS(FontComponent)) != NULL) 00298 { 00299 return TRUE; 00300 } 00301 else 00302 { 00303 // no document component - try to create one for this document 00304 FontComponent *pFontComponent = new FontComponent; 00305 00306 // now add this to the document 00307 pDoc->AddDocComponent(pFontComponent); 00308 00309 // success! 00310 return TRUE; 00311 } 00312 }
|
|
Registers the font component with the main application See Also: class DocComponentClass.
Reimplemented from SimpleCCObject. Definition at line 266 of file fontcomp.cpp. 00267 { 00268 // Instantiate a component class to register with the application 00269 FontComponentClass *pClass = new FontComponentClass; 00270 if (pClass==NULL) 00271 { 00272 return FALSE; 00273 } 00274 else 00275 { 00276 GetApplication()->RegisterDocComponent(pClass); 00277 return TRUE; 00278 } 00279 }
|