home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-08-10 | 4.5 KB | 140 lines | [TEXT/KAHL] |
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- // //
- // //
- // Copyright PennyWise Software, 1994. //
- // //
- // Part of the PennyWise Software Application Framework //
- // //
- // //
- // HandleMenus.c Written by Peter Kaplan //
- // //
- // //
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- // //
- // HandleMenus.c //
- // //
- // This file contains the menu processing core. All menu processing is handled //
- // from either this file, or the front most windows file. //
- // //
- // This file contains three routines: //
- // //
- // GlobalMenuDispatch(EventRecord*, WindowPtr, short, short, short) //
- // //
- // It gets installed in the default handlers as the MenuDispatch. //
- // This will get called when users make a menu selection (or keyboard //
- // combination). It will be called only when there is NO open //
- // application window or dialog OR the frontmost window passes it on //
- // without processing it. Once this routine is called the event is //
- // assumed handled. //
- // //
- // //
- // GlobalPreMenu(void) //
- // //
- // It works the same way as a windows PreMenu, you can make any //
- // changes to the menus you would like, but this routine is not //
- // limited to one window type. It is called for all menu clicks. //
- // The reason I implemented this was for building a "Windows" Menu //
- // where the same routine has to get called no matter what the //
- // window type. //
- // It gets called before the front most windows PreMenu call. //
- // //
- // GlobalPostMenu(void) //
- // //
- // It works the same way as a windows PostMenu, you should reverse //
- // changes to the menus you made in GlobalPreMenu. It is called for //
- // all menu clicks. //
- // //
- // NOTE: THESE ROUTINES ARE CALLED FROM THE FRAMEWORK LIBRARY SO YOU //
- // CAN NOT REMOVE THEM OR CHANGE THE NAMES. IF YOU DON'T WANT //
- // TO USE THEM, JUST LEAVE THEM EMPTY. //
- // //
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- #include "HandleMenus.h"
- #include "PWAboutBox.h"
- #include <PWFramework.h>
- #include <PWWindowList.h>
- #include <SegLoad.h>
- #include <TextServices.h>
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- // Added for PennyView
- #include "OpenFiles.h"
- #include <PWPrintUtils.h>
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- // Global Variables
- // All of the menus will have a definition here
- // and an external reference in the HeaderFile
- MenuHandle gMenuApple;
- MenuHandle gMenuFile;
- MenuHandle gMenuEdit;
-
- // Add your menus here
-
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- short GlobalMenuDispatch( EventRecord* theEvent,
- WindowPtr theWindow,
- short theMenu,
- short theItem,
- short theWindowType)
- {
- switch (theMenu) {
- case kMENU_ID_APPLE:
- switch (theItem) {
- short DNA;
- Str63 DAName;
- GrafPtr oldPort;
-
- case kAPPLE_ABOUT:
- DoAboutDialog();
- UnloadSeg(DoAboutDialog);
- break;
- default:
- GetPort(&oldPort);
- GetItem(gMenuApple, theItem, DAName);
- DNA = OpenDeskAcc(DAName);
- SetPort(oldPort);
- break;
- }
- break;
- case kMENU_ID_FILE:
- switch (theItem) {
- case kFILE_NEW:
- break;
- case kFILE_OPEN:
- AllWindowsGetFileOpen(); //•••••••••••Added For PennyView
- break;
- case kFILE_CLOSE:
- PWCallClose(theEvent, theWindow);
- break;
- case kFILE_PSETUP:
- DoPageSetup();
- break;
- case kFILE_PRINT:
- break;
- case kFILE_PONE:
- break;
- case kFILE_QUIT:
- PWQuitApplication();
- break;
- }
- break;
- case kMENU_ID_EDIT:
- switch (theItem) {
- default:
- break;
- }
- break;
- }
- return TRUE;
- }
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- void GlobalPreMenu(void)
- {
-
- }
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- void GlobalPostMenu(void)
- {
-
- }
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
-