home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
macify13.shr
/
macify.hqx
/
Source
/
P
/
PDoMenuMacify.c
< prev
next >
Wrap
Text File
|
1991-03-15
|
6KB
|
223 lines
/* PDoMenuMacify Handle a selection of the menu bar */
/* Unit name: PDoMenuMacify.c */
/* Function: This module calls the appropiate menu list */
/* handler routine. */
/* History: 3/15/91 Original by Prototyper 3.0 */
#include "PCommonMacify.h" /* Common */
#include "Common_Macify.h" /* Common */
#include "PUtils_Macify.h" /* General Utilities */
#include "Utils_Macify.h" /* General Utilities */
#include "AppleMenu.h" /* Menu handlers */
#include "FileMenu.h" /* Menu handlers */
#include "EditMenu.h" /* Menu handlers */
#include "PD_About_Dialog.h" /* Modal Dialog */
#include "DoMenuMacify.h" /* Extra menu handler */
#include "PDoMenuMacify.h" /* This file */
/* ======================================================= */
void DoMenuApple(short theItem); /* Handle this menu list */
void DoMenuFile(short theItem); /* Handle this menu list */
void DoMenuEdit(short theItem); /* Handle this menu list */
/* ======================================================= */
/* ======================================================= */
/* Routine: DoMenuApple */
/* Purpose: Handle all menu items in this list */
void DoMenuApple( theItem) /* Handle this menu selection */
short theItem;
{
Boolean SkipProcessing; /* TRUE says skip processing */
short DNA; /* For opening DAs */
Str255 DAName; /* For getting DA name */
GrafPtr SavePort; /* Save current port when opening DAs */
SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
Do_AppleMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
if (SkipProcessing == FALSE) /* See if process the menu list */
{
switch (theItem) { /* Handle all commands in this menu list */
case MItem_About_MACIFY:
PD_About_Dialog(); /* Call a modal dialog */
break;
default: /* Handle the DAs */
GetPort(&SavePort); /* Save the current port */
GetItem(Menu_Apple, theItem, DAName); /* Get the name of the DA selected */
DNA = OpenDeskAcc(DAName); /* Open the DA selected */
SetPort(SavePort); /* Restore to the saved port */
break;
} /* End of item case */
} /* End of not SkipProcessing */
Do_AppleMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
} /* End of procedure */
/* ======================================================= */
/* Routine: DoMenuFile */
/* Purpose: Handle all menu items in this list */
void DoMenuFile( theItem) /* Handle this menu selection */
short theItem;
{
Boolean SkipProcessing; /* TRUE says skip processing */
SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
Do_FileMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
if (SkipProcessing == FALSE) /* See if process the menu list */
{
switch (theItem) { /* Handle all commands in this menu list */
case MItem_Mac____UNIX:
call_macify(2);
/* Open_The_File(); /* Open a file */
/* Save_The_File(); */
break;
case MItem_UNIX____Mac:
call_macify(1);
/* Open_The_File(); /* Open a file */
/* Save_The_File(); */
break;
case MItem_Quit:
doneFlag = TRUE;
break;
default:
break;
} /* End of item case */
} /* End of not SkipProcessing */
Do_FileMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
} /* End of procedure */
/* ======================================================= */
/* Routine: DoMenuEdit */
/* Purpose: Handle all menu items in this list */
void DoMenuEdit( theItem) /* Handle this menu selection */
short theItem;
{
Boolean SkipProcessing; /* TRUE says skip processing */
Boolean BoolHolder; /* For SystemEdit result */
SkipProcessing = FALSE; /* Set to not skip the processing of this menu item */
Do_EditMenu(TRUE,theItem,&SkipProcessing); /* Pre menu handler */
if (SkipProcessing == FALSE) /* See if process the menu list */
{
BoolHolder = SystemEdit ( theItem - 1 ); /* Let the DA do the edit to itself */
if (BoolHolder == FALSE) /* If not a DA then we get it */
{ /* Handle by using a Case statment */
switch (theItem) { /* Handle all commands in this menu list */
case MItem_Undo:
break;
case MItem_Cut:
break;
case MItem_Copy:
break;
case MItem_Paste:
break;
case MItem_Clear:
break;
case MItem_Select_All:
break;
case MItem_Show_Clipboard:
break;
default: /* Send to a DA */
break;
} /* End of item case */
} /* End of not BoolHolder */
} /* End of not SkipProcessing */
Do_EditMenu(FALSE,theItem,&SkipProcessing); /* Post menu handler */
} /* End of procedure */
/* ======================================================= */
/* Routine: Handle_My_Menu */
/* Purpose: Vector off to the appropiate menu list handler */
void Handle_My_Menu( theMenu, theItem)
short theMenu;
short theItem;
{
switch (theMenu) /* Do selected menu list */
{
case Res_Menu_Apple:
DoMenuApple(theItem); /* Go handle this menu list */
break;
case Res_Menu_File:
DoMenuFile(theItem); /* Go handle this menu list */
break;
case Res_Menu_Edit:
DoMenuEdit(theItem); /* Go handle this menu list */
break;
default:
Handle_Other_Menus(theMenu,theItem); /* Handle other special menus */
break;
} /* End for the Lists */
HiliteMenu(0); /* Turn menu selection off */
} /* End of procedure Handle_My_Menu */