| version 1.1, 2003/10/31 16:55:06 | version 1.6, 2004/03/02 23:23:06 | 
| Line 11 | Line 11 | 
 | #include "np2.h" | #include "np2.h" | 
 | #include "macalert.h" | #include "macalert.h" | 
 |  |  | 
| static AlertStdAlertParamRec makeDefaultParam(void) { | static SInt16 showCautionAlert(CFStringRef title, CFStringRef string, CFStringRef button) { | 
| AlertStdAlertParamRec       param; | DialogRef   ret; | 
|  | AlertStdCFStringAlertParamRec       param; | 
|  | DialogItemIndex     hit; | 
 |  |  | 
 |  | GetStandardAlertDefaultParams(¶m, kStdCFStringAlertVersionOne); | 
 | param.movable = true; | param.movable = true; | 
 | param.helpButton = false; |  | 
 | param.filterProc = NULL; |  | 
 | param.defaultText = (ConstStringPtr)kAlertDefaultOKText; |  | 
 | param.cancelText = NULL; |  | 
 | param.otherText = NULL; |  | 
 | param.defaultButton = kAlertStdAlertOKButton; |  | 
 | param.cancelButton = NULL; |  | 
 | param.position = kWindowDefaultPosition; |  | 
 |  |  | 
 | return(param); |  | 
 | } |  | 
 |  |  | 
 | static SInt16 showCautionAlert(const Str255 title, Str255 string, const Str255 button) { |  | 
 | SInt16      ret; |  | 
 | AlertStdAlertParamRec       param = makeDefaultParam(); |  | 
 |  |  | 
 | param.defaultText = button; |  | 
 | param.cancelText = (ConstStringPtr)kAlertDefaultCancelText; |  | 
 | param.cancelButton = kAlertStdAlertCancelButton; | param.cancelButton = kAlertStdAlertCancelButton; | 
|  | param.cancelText = param.defaultText; | 
| StandardAlert(kAlertCautionAlert, title, string, ¶m, &ret); | if (button) param.defaultText = button; | 
| return(ret); |  | 
|  | CreateStandardAlert(kAlertCautionAlert, title, string, ¶m, &ret); | 
|  | SysBeep(0); | 
|  | RunStandardAlert(ret, NULL, &hit); | 
|  | return(hit); | 
 | } | } | 
|  | /* | 
|  | #if defined(CPUCORE_IA32) | 
|  | void msgbox (char* title, char* msg) { | 
|  | DialogItemIndex hit; | 
|  | CFStringRef             cftitle, cfmsg; | 
|  |  | 
|  | cftitle = CFSTRj(title); | 
|  | cfmsg = CFSTRj(msg); | 
|  | hit = showCautionAlert(cftitle, cfmsg, NULL); | 
|  | if (cftitle) CFRelease(cftitle); | 
|  | if (cfmsg) CFRelease(cfmsg); | 
|  | return; | 
|  | } | 
|  | #endif | 
|  | */ | 
 | void ResumeErrorDialogProc(void) { | void ResumeErrorDialogProc(void) { | 
| SInt16      ret; | DialogRef   ret; | 
| AlertStdAlertParamRec       param = makeDefaultParam(); | AlertStdCFStringAlertParamRec       param; | 
| StandardAlert(kAlertStopAlert, "\pCouldn't restart", NULL, ¶m, &ret); | DialogItemIndex     hit; | 
|  |  | 
|  | GetStandardAlertDefaultParams(¶m, kStdCFStringAlertVersionOne); | 
|  | param.movable = true; | 
|  | CreateStandardAlert(kAlertStopAlert, CFCopyLocalizedString(CFSTR("Couldn't restart"), "Resume Error Message"), | 
|  | CFCopyLocalizedString(CFSTR("An error occured when reading the np2.sav file. Neko Project IIx couldn't restart."), "Resume Error Description"), | 
|  | ¶m, &ret); | 
|  | SysBeep(0); | 
|  | RunStandardAlert(ret, NULL, &hit); | 
 | } | } | 
 |  |  | 
 | int ResumeWarningDialogProc(const char *string) { | int ResumeWarningDialogProc(const char *string) { | 
 | SInt16      ret; | SInt16      ret; | 
 | Str255      str; |  | 
 |  |  | 
| mkstr255(str, string); | ret = showCautionAlert(     CFCopyLocalizedString(CFSTR("The Save Data file is conflicting"), "bad data"), | 
| ret = showCautionAlert("\pConflict", str, "\pContinue"); | CFStringCreateWithCString(NULL, string, CFStringGetSystemEncoding()), | 
|  | CFCopyLocalizedString(CFSTR("Continue"), "OK")); | 
 | if (ret = kAlertStdAlertOKButton) { | if (ret = kAlertStdAlertOKButton) { | 
 | return(IDOK); | return(IDOK); | 
 | } | } | 
| Line 61  bool ResetWarningDialogProc(void) { | Line 72  bool ResetWarningDialogProc(void) { | 
 | SInt16      ret; | SInt16      ret; | 
 |  |  | 
 | if (np2oscfg.comfirm) { | if (np2oscfg.comfirm) { | 
| ret = showCautionAlert("\pReset", NULL, "\pReset"); | ret = showCautionAlert( CFCopyLocalizedString(CFSTR("Reset"), "Reset title"), | 
|  | CFCopyLocalizedString(CFSTR("Are you sure you want to reset?"), "Reset causion string"), | 
|  | NULL); | 
 | if (ret == kAlertStdAlertCancelButton) { | if (ret == kAlertStdAlertCancelButton) { | 
 | return(false); | return(false); | 
 | } | } | 
 | } | } | 
 | return(true); | return(true); | 
 | } |  | 
 |  |  | 
 |  | } | 
 |  |  | 
 |  | bool QuitWarningDialogProc(void) { | 
 |  | SInt16      ret; | 
 |  |  | 
 |  | if (np2oscfg.comfirm) { | 
 |  | ret = showCautionAlert( CFCopyLocalizedString(CFSTR("Quit"), "Quit title"), | 
 |  | CFCopyLocalizedString(CFSTR("Are you sure you want to quit?"), "Quit causion string"), | 
 |  | NULL); | 
 |  | if (ret == kAlertStdAlertCancelButton) { | 
 |  | return(false); | 
 |  | } | 
 |  | } | 
 |  | return(true); | 
 |  | } |