| Methods Index |
CResourceSubclasses: None
CMenuBar theMenuBar(theWin, MENU_ID);
const short kResErrBase = 5150;
CResource *theRes = new CResourceMenu(MENU_BAR_RID);
PwrAssert(theRes, kResErrBase + 1,
"Unable to bake resource.");
theRes->Hold();
theRes->FirstItem(); // reset iterator
long theId;
while (theId = theRes->NextItem()) {
CSubmenu theSubmenu;
theRes->IObject(theId, &theSubmenu);
theMenuBar.AppendSubmenu(theSubmenu);
}
theRes->Release();
delete theRes;
GetItemType:
|
|
PwrSubMenu
|
PwrMenuItem
|
CResourceMenu(long theId);
theId is the URL resource ID for the menu.
virtual ~CResourceMenu(void);
virtual BOOLEAN Hold(void);
CResource abstract method to specify how to load a menu resource from a URL file. Returns TRUE upon success (FALSE if the resource could not be loaded from URL). See CResource.
virtual void Release(void);
CResource abstract method to specify how to free the internal memory associated with a menu resource and which pointers to reset. See CResource.
virtual BOOLEAN IObject(long theId,
CObjectRWC *theObject);
CResource abstract method to specify the initializer for a CResourceMenu. Initializes a top-level CSubmenu. It returns TRUE if the initialization succeeds.
virtual long FirstItem(void);
CResource abstract method to specify the resource ID for the menubar itself. This is also a way to reset the resource iterator to return the ID of the first top-level submenu.
virtual long NextItem(void);
CResource abstract method to specify how to move forward in the internal representation of menu resources (menu and associated menu items and submenus).
virtual long GetItemType(long theId);
CResource abstract method to return the object type given a resource ID (see "Enums").
CResourceMenu(const CResourceMenu &theResource);
CResourceMenu & operator=(
const CResourceMenu &theResource);
void BuildSubmenu(MENU_ITEM *theXVTMenu,
CSubmenu *theSubMenu, CMenu *theMenu);
CSubMenu XVT-Power++ object from an array of MENU_ITEM structures. theSubMenu is the CSubmenu object being built. theXVTMenu is the array of MENU_ITEM structures, and theMenu is the menu to attach this submenu with.
void InitMenu(MENU_ITEM* theXVTMenu, CMenu *theMenu);
CMenu object from an array of MENU_ITEM structures, theXVTMenu is the array of MENU_ITEM structures and theMenu is the CMenu to build.