UnitListComponentClass Class Reference

Provide a class that will add Unit List components to new documents. More...

#include <unitcomp.h>

Inheritance diagram for UnitListComponentClass:

DocComponentClass ListItem CCObject SimpleCCObject List of all members.

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.

Detailed Description

Provide a class that will add Unit List components to new documents.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
See also:
DocComponentClass

Definition at line 120 of file unitcomp.h.


Member Function Documentation

BOOL UnitListComponentClass::AddComponent BaseDocument pDocument  )  [virtual]
 

Add a unit list component to the specified document.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Parameters:
pDocument - the document to add the unit list to. [INPUTS]
Returns:
TRUE if the unit list was added ok; FALSE if not.

Errors: Out of memory

See also:
UnitListComponentClass

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 }

BOOL UnitListComponentClass::Init void   )  [static]
 

Register the unit list document component with the main application.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/07/96
Returns:
TRUE if all went well; FALSE if not.

Errors: Out of memory.

See also:
DocComponent

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:40 2007 for Camelot by  doxygen 1.4.4