home *** CD-ROM | disk | FTP | other *** search
- /* Capture program - example of serial port control
- *
- * Programmer: James R. Logan Jr.
- * Organization: Brigham Young University
- */
-
- #include "QuickDraw.h"
- #include "MacTypes.h"
- #include "WindowMgr.h"
- #include "TextEdit.h"
- #include "ControlMgr.h"
- #include "EventMgr.h"
-
- #include "capture.h"
-
- extern WindowPtr
- whichwindow, /* Working variable to test which window is the frontmost */
- noticeWindow; /* Window for copyright notice */
-
- extern WindowRecord
- nrecord; /* Window record for copyright notice */
-
- static char *notice = "\p Capture V1.1\rCopyright ⌐ 1989,1990\r Brigham Young University\r";
-
- static char *developercredit =
- "\pCaptures data from a serial port.\r\
- An example of serial port control.\r";
-
- static char *notice2 =
- "\pYou may use this application and its source\r\
- for any purpose if credit is given given to the\r\
- developer and Brigham Young University\r\
- Computer Science Department\r\
- Provo, Utah 84602\r\
- (801) 378-3027";
-
- static char *cost =
- "\pDeveloper: James R. Logan Jr.\r\
- Portions Copyrighted by Think Technologies.";
-
-
- /* Wait here for mouseDown event */
-
- WaitForButton() {
- EventRecord event;
- do {
- SystemTask();
- GetNextEvent(everyEvent, &event);
- }
- while ((event.what != mouseDown) && (event.what != keyDown));
- }
-
-
- /* Do "About Capture" copyright notice */
-
- DoAbout(g) screen *g; {
- Rect sRect,box;
-
- GrafPtr tempPort;
-
- GetPort(&tempPort);
- ShowWindow( noticeWindow);
- SelectWindow( noticeWindow);
- SetPort( noticeWindow);
- SetRect(&sRect,0,0,400,500);
- EraseRect( &sRect);
-
- MoveTo(0,20);
- TextSize(12); TextFace(0); TextFont(0);
- SetRect(&box, 0, 5, 232, 100);
- OffsetRect(&box, 10, 10);
-
- TextBox( ¬ice[1], notice[0], &box ,teJustCenter);
-
- OffsetRect(&box, 0, 58);
- TextBox(&developercredit[1], developercredit[0], &box, teJustCenter);
-
- OffsetRect(&box, 0, 40);
- TextFace(0); TextFont(geneva); TextSize(9);
- TextBox(¬ice2[1], (unsigned char) notice2[0], &box, teJustCenter);
-
- OffsetRect(&box, 0, 82);
- TextFace(0); TextFont(geneva); TextSize(9);
-
- TextBox( &cost[1], (unsigned char) cost[0], &box, teJustCenter);
-
- WaitForButton();
-
- SetPort(tempPort);
-
- HideWindow(noticeWindow);
- }
-