| Methods Index |
Subclass: None
CResourceFactoryDefault
#include CGlobalClassLib_i
#include PwrFactoryDef_i
...
RESOURCE_FACTORY->ConstructNButton(aSubview,
aContainerId, anId);
NButton generation, for example, you should design a concrete subclass of CResourceFactory, overriding only those virtual constructors you're interested in.
class CMyResourceFactory : public CResourceFactoryThen install an instance of this factory into the factory manager as soon as the manager is created, within
{
public:
virtual NButton* ConstructNButton(CSubview*
theSubview, long theContainerId, long theId)
return net CMyNButton(theSubview, theContainerId,
theId);}
CMyResourceFactory() : CResourceFactory()
{}
};
CApplication::InstallFactories(...)
void CMyApplication::InstallFactories(CFactoryMgr* mgr)Then remember to delete the factory after it is no longer used, because the factory manager will not delete it for you.
{
CApplication::InstallFactories(mgr);
itsMyResourceFactory = new CMyResourceFactory;
mgr->AddFactory(kResourceFactoryTypeId,
itsMyResourceFactory);
}
void CMyApplication::ShutDown()
{
CApplication::ShutDown();
delete itsMyResourceFactory;
}
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();
CResourceFactory();