[Classes] [Prev] [Next] [Methods]

CResourceFactory

Methods Index

Heritage
Description
Usage
Override
Public Methods
Protected Methods

CResourceFactory


Heritage

Superclass: None

Subclass: None CResourceFactoryDefault


Description

This abstract factory is by the framework to create native views from resources.


Usage

#include CGlobalClassLib_i
#include PwrFactoryDef_i
...
RESOURCE_FACTORY->ConstructNButton(aSubview,
aContainerId, anId);

Override

To override the NButton generation, for example, you should design a concrete subclass of CResourceFactory, overriding only those virtual constructors you're interested in.

class CMyResourceFactory : public CResourceFactory
{
public:
virtual NButton* ConstructNButton(CSubview*
theSubview, long theContainerId, long theId)
return net CMyNButton(theSubview, theContainerId,
theId);}
CMyResourceFactory() : CResourceFactory()
{}
};
Then install an instance of this factory into the factory manager as soon as the manager is created, within CApplication::InstallFactories(...)

void CMyApplication::InstallFactories(CFactoryMgr* mgr)
{
CApplication::InstallFactories(mgr);
itsMyResourceFactory = new CMyResourceFactory;
mgr->AddFactory(kResourceFactoryTypeId,
itsMyResourceFactory);
}
Then remember to delete the factory after it is no longer used, because the factory manager will not delete it for you.

void CMyApplication::ShutDown()
{
CApplication::ShutDown();
delete itsMyResourceFactory;
}

Public Methods

virtual NButton* ConstructNButton(CSubview*, 
long theContainerId, long theId);
virtual CRadioGroup* ConstructCRadioGroup(CSubview*,
long theContainerId, long theId);
virtual NCheckBox* ConstructNCheckBox(CSubview*,
long theContainerId, long theId);
virtual NScrollBar* ConstructNScrollBar(CSubview*,
long theContainerId, long theId);
virtual NEditControl* ConstructNEditControl(CSubview*,
long theContainerId, long theId);
virtual NText* ConstructNText(CSubview*,
long theContainerId, long theId);
virtual NListBox* ConstructNListBox(CSubview*,
long theContainerId, long theId);
virtual NIcon* ConstructNIcon(CSubview*,
long theContainerId, long theId);
virtual NListButton* ConstructNListButton(CSubview*,
long theContainerId, long theId);
virtual NListEdit* ConstructNListEdit(CSubview*,
long theContainerId, long theId);
virtual NGroupBox* ConstructNGroupBox(CSubview*,
long theContainerId, long theId);
virtual NScrollText* ConstructNScrollText(CSubview*,
long theContainerId, long theId);
virtual NRadioButton* ConstructNRadioButton(
CRadioGroup*, long theContainerId, long theId);
virtual CResourceWindow* ConstructCResourceWindow(long theId); virtual CResourceMenu* ConstructCResourceMenu(long theId);
virtual ~CResourceFactory();

Protected Methods

CResourceFactory();


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.