<< Return to Main Index

< Return to Class Index

class CGXAbstractControlFactory

Abstract base class.

In order to create a Control Factory Class for your application you have to derive a class from CGXAbstractControlFactory and override all the pure virtual methods. The “Control Factory Wizard” fully automates the creation of the Control Factory Class. See the section "Reducing the size of your application" in the Objective Grid User's Guide for more information on how to use the Control Factory Wizard to create a Control Factory Class.

Responsibilities of the Control Factory Class are:

If you are linking your application statically to Objective Grid and are concerned about the size of your application, a Control Factory lets you specify which cell types should be linked into your application and excludes cell types and features you don’t need. This will shrink the size of your final application.

How do I use the Control Factory Class?

You have two choices:

If a) is your choice, simply derive a class from CGXControlFactory (the default factory class implementation) and override the following virtual methods:

In the InitInstance method of your application object, you have to register your control factory by inserting the following line (instead of using the standard GXInit() call):

GXInit(new CMyControlFactory);

In the OnInitialUpdate method of your view class you can specify whether user attributes and cell types should be visible in the CGXStyleSheet by inserting the following lines:

// Register default controls for the CGXStyleSheet-Controls

// page (control objects will be created on demand in

// CGXControlFactory).

stylesmap->RegisterDefaultControls();

// Register user attributes for the CGXStyleSheet-User

// Attributes page (control objects will be created on

// demand in CGXControlFactory).

stylesmap->RegisterDefaultUserAttributes();

If you do not want the attributes and cell types visible in the CGXStyleSheet, then you should skip the previous lines of code. You will still be able to use the cell type objects and user attributes in your grid. They will only be hidden from the user in the CGXStyleSheet.

#include <gxall.h>

See Also

CGXGridCore::GetRegisteredControl GXInit GXTerminate CGXStylesMap::RegisterDefaultControls CGXStylesMap::RegisterDefaultUserAttributes CGXControlFactory

CGXAbstractControlFactory

Class Members