home *** CD-ROM | disk | FTP | other *** search
- #include "MenuManager.h"
- #include "BaseMenu.h"
-
-
-
-
-
- extern MenuManager *gMenuManager;
-
-
-
-
-
- BaseMenu::BaseMenu(UInt32 menuID)
- {
- fMenu = ::GetMenu(menuID);
- if (fMenu != NULL)
- {
- fFlags = 0;
- gMenuManager->DoAddMenu(this);
- }
- }
-
-
-
-
-
- void BaseMenu::DoUpdate(void)
- {
- HandleUpdate();
- }
-
-
-
-
-
- void BaseMenu::DoSelect(UInt32 item)
- {
- HandleSelect(item);
- }
-
-
-
-
-
- Boolean BaseMenu::DoSetDisableState(Boolean isBeingDisabled)
- {
- if (isBeingDisabled)
- {
- if (!(fFlags & kDisabled))
- {
- fFlags |= kDisabled;
- HandleSetDisableState(isBeingDisabled);
- return true;
- }
- }
- else
- {
- if (fFlags & kDisabled)
- {
- fFlags &= ~kDisabled;
- HandleSetDisableState(isBeingDisabled);
- return true;
- }
- }
-
- return false;
- }
-
-
-
-
-
- void BaseMenu::DoWindowNotice(Window *window,Boolean isBeingAdded)
- {
- HandleWindowNotice(window,isBeingAdded);
- }
-
-
-
-
-
- void BaseMenu::DoWindowActivation(Window *window,Boolean isBeingActivated)
- {
- HandleWindowActivation(window,isBeingActivated);
- }
-
-
- #pragma mark -
-
-
- void BaseMenu::HandleUpdate(void)
- {
-
- }
-
-
-
-
-
- void BaseMenu::HandleSelect(UInt32 item)
- {
-
- }
-
-
-
-
-
- void BaseMenu::HandleSetDisableState(Boolean isBeingDisabled)
- {
- if (isBeingDisabled)
- DisableItem(fMenu,0);
- else
- EnableItem(fMenu,0);
- }
-
-
-
-
-
- void BaseMenu::HandleWindowNotice(Window *window,Boolean isBeingAdded)
- {
-
- }
-
-
-
-
-
- void BaseMenu::HandleWindowActivation(Window *window,Boolean isBeingActivated)
- {
-
- }