home *** CD-ROM | disk | FTP | other *** search
- /*
- * procs.c
- * by Gaige B. Paulsen
- ****************************************************************************
- * Part of NCSA Telnet for the Macintosh *
- * *
- * Uses : *
- * TCP/IP kernel for NCSA Telnet *
- * by Tim Krauskopf *
- * with Macintosh code by Gaige B. Paulsen *
- * *
- * National Center for Supercomputing Applications *
- * 152 Computing Applications Building *
- * 605 E. Springfield Ave. *
- * Champaign, IL 61820 *
- * *
- * *
- ****************************************************************************
- *
- * A place to put some of those routines called by lots of people.
- *
- * Called by:
- * menu.c
- * maclook.c
- * prefs.c
- */
-
- /*
- * Files for inclusion.
- */
- #include <stdio.h>
- #include <ctype.h>
-
- #include <Controls.h>
- #include <Desk.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Fonts.h>
- #include <Menus.h>
- #include <OSUtils.h> /* for Juggler */
- #include <Packages.h>
- #include <Quickdraw.h>
- #include <Resources.h>
- #include <Script.h>
- #include <ToolUtils.h>
- #include <Windows.h>
-
- #include "VSkeys.h"
- #include "util.h"
-
- #include "wind.h"
-
- #ifdef MPW
- #include "mpw.h"
- #endif
-
-
- /*
- * Event Auxilliary Defines
- */
-
- #define MouseEvents 6 /* All mouse events, but no others */
- #define WaitEvents 10 /* Mouse and Keyboard Dn Events for the Wait4Mouse() */
- #define BScode 51 /* This is the Keycode for Backspace */
- #define KPlowest 65 /* This is the last code before the KP */
-
- #define switchEvt 1 /* Switching event (suspend/resume ) for app4evt */
-
- #define WAITTICKS 3L /* One (Half) now tenth now 1/20th second for the first try.... */
-
- pascal short modalProc( dptr, evt, item)
- DialogPtr dptr;
- EventRecord *evt;
- short *item;
- {
- #pragma unused(dptr)
- extern int neton; /* From Maclook, if net has been inited yet */
- extern short modalItems,modalItem[],modalKey[]; /* BYU serial - From menu.c, item # for option key */
- int keyCount,keyCode; /* BYU serial - added keyCount */
-
- if (evt->what == keyDown) {
- keyCode = (evt->message >>8) & 0xff ;
- if (keyCode ==0x24 || keyCode == 0x4c) {
- *item = 1;
- return(TRUE);
- }
- if (keyCode ==0x2f && (evt->modifiers & cmdKey)) {
- *item = 2;
- return(TRUE);
- }
- for (keyCount = 0; keyCount < modalItems; keyCount++) { /* BYU serial */
- if ((keyCode ==modalKey[keyCount]) && (evt->modifiers & cmdKey)) { /* BYU serial */
- *item = modalItem[keyCount]; /* BYU serial - enable option */
- return(-1); /* BYU serial */
- } /* BYU serial */
- }
- }
- if (neton) Stask();
- return(FALSE);
- }
-