home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-08-08 | 2.1 KB | 88 lines | [TEXT/KAHL] |
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- // //
- // //
- // Copyright PennyWise Software, 1994. //
- // //
- // Part of the PennyWise Software Application Framework //
- // //
- // //
- // ErrorDialog.c Written by Peter Kaplan //
- // //
- // //
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- #include "ErrorDialog.h"
- #include <PWDialogUtils.h>
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- void ErrorDialog(short theID, short theIndex, unsigned char *theOneString)
- {
- Str255 theErrorString;
- WindowPtr theDialog;
- short itemHit;
- GrafPtr oldPort;
-
-
- GetPort(&oldPort);
-
- GetIndString(theErrorString, theID, theIndex);
- ParamText(theErrorString, theOneString,NULL, NULL);
-
- theDialog = GetNewDialog( kERROR_DIALOG, NULL, (WindowPtr)-1);
-
- if (theDialog) {
- SetDialogDefaultItem( theDialog, kBTTN_OK);
-
- SysBeep(1);
- ShowWindow (theDialog);
- SelectWindow(theDialog);
- SetPort (theDialog);
-
- do {
- ModalDialog( NULL, &itemHit);
-
- }while (itemHit!=kBTTN_OK);
- HideWindow(theDialog);
- DisposDialog( theDialog);
- }
- SetPort(oldPort);
- }
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- short SaveDialog(unsigned char * theString)
- {
- WindowPtr theDialog;
- short itemHit;
- GrafPtr oldPort;
-
-
- GetPort(&oldPort);
-
- SetCursor(&qd.arrow);
- if (theString != NULL)
- ParamText((unsigned char*)theString, NULL,NULL, NULL);
-
- itemHit = 0;
-
- theDialog = GetNewDialog( kSAVE_DIALOG, NULL, (WindowPtr)-1);
- if (theDialog) {
-
- SetDialogDefaultItem( theDialog, kBTTN_OK);
- SetDialogCancelItem ( theDialog, kBTTN_CANCEL);
-
- ShowWindow (theDialog);
- SelectWindow(theDialog);
- SetPort (theDialog);
-
- do {
- ModalDialog( NULL, &itemHit);
-
- }while (itemHit==0);
-
- HideWindow(theDialog);
- DisposDialog( theDialog);
- }
-
- SetPort(oldPort);
-
- return itemHit;
- }
- //••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
-