home *** CD-ROM | disk | FTP | other *** search
- #define OLDROUTINELOCATIONS 0
- #define OLDROUTINENAMES 0
- #define SystemSevenOrLater 1
-
- #ifndef __FONTS__
- # include <Fonts.h>
- #endif
-
- #ifndef __DIALOGS__
- # include <Dialogs.h>
- #endif
-
- #include "MoveableModalDialog.h"
-
- static pascal OSErr InitMac (void)
- {
- MaxApplZone ( );
- InitGraf (&(qd.thePort));
- InitFonts ( );
- InitWindows ( );
- InitMenus ( );
- TEInit ( );
- InitDialogs (nil);
-
- return noErr;
- }
-
- static pascal Boolean ModalFilterProc (DialogRef dialog, EventRecord *event, short *itemHit)
- {
- return StdFilterProc (dialog,event,itemHit);
- }
-
- void main (void)
- {
- if (InitMac ( ))
- SysBeep (10);
- else
- {
- DialogRef dlgRef = GetNewDialog (129,nil,(WindowRef)-1);
- if (dlgRef)
- {
- ModalFilterUPP modalFilterUPP = NewModalFilterProc (ModalFilterProc);
- if (modalFilterUPP)
- {
-
- short itemHit;
-
- SetDialogDefaultItem (dlgRef,ok);
- SetDialogTracksCursor (dlgRef,true);
-
- do
- {
- MoveableModalDialog (modalFilterUPP,&itemHit);
- }
- while (itemHit != ok);
-
- DisposeRoutineDescriptor (modalFilterUPP);
- }
- DisposeDialog (dlgRef);
- }
- }
- }
-