/****************************/
/*        MENUS             */
/* (c)1995 Pangea Software  */
/* By Brian Greenstone      */
/****************************/


/***************/
/* EXTERNALS   */
/***************/

extern	EventRecord			gTheEvent;


/******************/
/*  PROTOTYPES    */
/******************/



/****************************/
/*    CONSTANTS             */
/****************************/

									// MENU BAR ITEMS //
#define	NOT_A_NORMAL_MENU	-1
#define	APPLE_MENU_ID		400
#define	FILE_MENU_ID		401

#define MAIN_MENUBAR_ID		400


									// FILE MENU ITEMS //
enum
{
	LINK_ITEM	= 1,
};



/**********************/
/*     VARIABLES      */
/**********************/

MenuHandle	gAppleMenu;


/******************/
/* INIT MENU BAR  */
/******************/

void InitMenuBar(void)
{
Handle	myMenuBar;
		
					/* ALLOCATE MAIN MENU BAR */
	
	if ((myMenuBar	=	GetNewMBar(MAIN_MENUBAR_ID)) == NIL_POINTER)
			DoFatalAlert("\pWhered the menu bar go?!");;
	SetMenuBar(myMenuBar);
	
					/* SET APPLE MENU */

	if ((gAppleMenu	=	GetMenuHandle(APPLE_MENU_ID)) == NIL_POINTER)
			DoFatalAlert("\pGetMHandle failed!");;
	
					/* APPEND DESK ACCESSORIES */
									
	AppendResMenu (gAppleMenu, 'DRVR');
	
	DrawMenuBar();
}


/***************************/
/* HANDLE MENU BAR CHOICE  */
/***************************/

void HandleMenuChoice(long menuChoice)
{
short	theMenu;
short	theItem;
		
	if	(menuChoice != 0)
	{
		theMenu	=	HiWord(menuChoice);
		theItem	=	LoWord(menuChoice);
		switch	(theMenu)
		{
			case	FILE_MENU_ID:
					HandleFileChoice(theItem);
					break;
					
		}
		HiliteMenu(0);
	}
}



/****************************/
/* HANDLE FILE MENU CHOICE  */
/****************************/

void HandleFileChoice(short theItem)
{

	switch(theItem)
	{
		case	LINK_ITEM:
				ExecuteMakefile();
				break;				
	}
}



/****************************/
/* HANDLE EDIT MENU CHOICE  */
/****************************/

void HandleEditChoice(short theItem)
{		
	switch(theItem)
	{

	}
}



