| Methods Index |
CResourceSubclasses: None
const short kResErrBase = 5150;
CResource *theRes = new CResourceWindow(WIN_ID);
PwrAssert(theRes, kResErrBase + 1,
"Unable to bake resource.");
theRes->Hold();
theRes->FirstItem(); // reset iterator
long theId;
while (theId = theRes->NextItem()) {
CObjectRWC *theObject = NULL;
switch (theRes->GetItemType(theId)) {
case WC_BUTTON:
theObject = new NButton(itsEnclosure,
WIN_ID, theId);
break;
case WC_EDIT:
theObject = new NEdit(itsEnclosure, WIN_ID,
theId);
break;
}
PwrAssert(theObject, kResErrBase + 2,
"Unable to bake resource item.");
theRes->IObject(theId, theObject);
CastPtr(CView, theObject)->SetCommand(theId);
}
theRes->Release();
delete theRes;
CResourceWindow(long theId);
theId represents the window's URL resource ID.
virtual ~CResourceWindow(void);
virtual BOOLEAN Hold(void);
CResource abstract method to specify how to load a window resource from a URL file. It calls get_res_window which brings a monolithic array in memory, then sets this array so that it can be traversed later. See CResource.
virtual void Release(void);
CResource abstract method to specify how to free the internal memory associated with a window resource and which pointers to reset. See CResource.
virtual BOOLEAN IObject(long theId,
CObjectRWC *theObject);
theId is the resource ID and theObject is the CResourceWindow object to initialize.
virtual long FirstItem(void);
virtual long NextItem(void);
NextItem provides a way to traverse through the list of views or controls populating a window. The first time NextItem is called, it returns the window ID itself.
virtual long GetItemType(long theId);
theId.
void ConvertWinDefUnits(void);
WIN_DEF* FindWinDefEntry(long theId);
CResourceWindow(const CResourceWindow &theResource);
CResourceWindow & operator=(
const CResourceWindow &theResource);