diff --git a/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.cpp b/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.cpp new file mode 100644 index 0000000000..78252d9c5f --- /dev/null +++ b/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.cpp @@ -0,0 +1,29 @@ +/* + * ErrorDialog_darwin.cpp + * stepmania + * + * Created by Steve Checkoway on Wed Jul 23 2003. + * Copyright (c) 2003 Steve Checkoway. All rights reserved. + * + */ + +#include "global.h" +#include "ErrorDialog_darwin.h" +#include + +void ErrorDialog_darwin::ShowError() { + CFStringRef error = CFStringCreateWithCString(NULL, GetErrorText().c_str(), kCFStringEncodingASCII); + CFStringRef OK = CFStringCreateWithCString(NULL, "OK", kCFStringEncodingASCII); + struct AlertStdCFStringAlertParamRec params = {kStdCFStringAlertVersionOne, true, false, OK, NULL, NULL, + kAlertStdAlertOKButton, NULL, kWindowAlertPositionParentWindowScreen, NULL}; + DialogRef dialog; + SInt16 unused; + OSErr err; + + CreateStandardAlert(kAlertStopAlert, error, NULL, ¶ms, &dialog); + err = AutoSizeDialog(dialog); + ASSERT(err == noErr); + RunStandardAlert(dialog, NULL, &unused); + CFRelease(error); + CFRelease(OK); +} diff --git a/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.h b/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.h new file mode 100644 index 0000000000..e9bca6f425 --- /dev/null +++ b/stepmania/src/arch/ErrorDialog/ErrorDialog_darwin.h @@ -0,0 +1,23 @@ +#ifndef ERROR_DIALOG_DARWIN_H +#define ERROR_DIALOG_DARWIN_H +/* + * ErrorDialog_darwin.h + * stepmania + * + * Created by Steve Checkoway on Wed Jul 23 2003. + * Copyright (c) 2003 Steve Checkoway. All rights reserved. + * + */ + +#include "ErrorDialog.h" + +class ErrorDialog_darwin : public ErrorDialog { +public: + void ShowError(); +}; + +#undef ARCH_ERROR_DIALOG +#define ARCH_ERROR_DIALOG ErrorDialog_darwin + +#endif /* ERROR_DIALOG_DARWIN_H */ + \ No newline at end of file diff --git a/stepmania/src/arch/arch_darwin.h b/stepmania/src/arch/arch_darwin.h index 7f6444dcf0..8da0e05441 100644 --- a/stepmania/src/arch/arch_darwin.h +++ b/stepmania/src/arch/arch_darwin.h @@ -15,7 +15,7 @@ #include "LoadingWindow/LoadingWindow_Cocoa.h" #include "InputHandler/InputHandler_SDL.h" #include "LowLevelWindow/LowLevelWindow_SDL.h" - +#include "ErrorDialog/ErrorDialog_darwin.h" #include "ArchHooks/ArchHooks_darwin.h" #endif