home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
lang
/
skel_azt.sha
/
click.c
< prev
next >
Wrap
C/C++ Source or Header
|
1986-07-08
|
1KB
|
74 lines
/*
* click.c -- handle mouse click anywhere outside desk accessory
* windows
*/
#include <quickdraw.h>
#include <control.h>
#include <desk.h>
#include <event.h>
#include <memory.h>
#include <menu.h>
#include <osutil.h>
#include <textedit.h>
#include <window.h>
#include "def.h"
click(ev)
EventRecord *ev; /* return value from GetNextEvent */
{
extern ControlHandle hscroll[NWINDOWS];
extern TEHandle hTE;
int i;
extern MenuHandle mh[NMENUS + 1];
WindowPtr mwp;
extern ControlHandle vscroll[NWINDOWS];
extern Rect wdragr;
int windowcode;
extern WindowPtr wp[NWINDOWS];
windowcode = FindWindow (pass(ev->where), &mwp);
switch (windowcode) {
case inDesk:
SysBeep(1);
break;
case inMenuBar:
return(command(MenuSelect(&ev->where)));
break;
case inSysWindow:
SystemClick(ev, mwp);
break;
case inContent: /* if inactive window, includes grow box */
if (mwp != FrontWindow())
SelectWindow(mwp);
else {
for (i = 0; i < NWINDOWS; i++)
if (mwp == wp[i]) {
appclick(ev, i);
break;
};
};
break;
case inDrag:
DragWindow(mwp, pass(ev->where), &wdragr);
break;
case inGrow: /* see inContent above */
for (i = 0; i < NWINDOWS; i++)
if (mwp == wp[i]) {
extern void resize();
resize(i, pass(ev->where));
break;
};
break;
case inGoAway:
if (TrackGoAway(mwp, pass(ev->where)) &&
mwp == wp[1])
txfin();
break;
};
return(FALSE);
} /* end of click */