add MessageBox to ArchHooks to get rid of WIN32 #ifdefs
This commit is contained in:
@@ -28,6 +28,11 @@ public:
|
||||
* and we can safely log and throw. */
|
||||
virtual void DumpDebugInfo() { }
|
||||
|
||||
/* Message box stuff. Not supported on all archs. */
|
||||
enum MessageBoxResult { abort, retry, ignore };
|
||||
virtual void MessageBoxOK( CString sMessage ) {}
|
||||
virtual MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage ) { return ignore; }
|
||||
|
||||
virtual ~ArchHooks() { }
|
||||
};
|
||||
|
||||
|
||||
@@ -34,6 +34,22 @@ void ArchHooks_Win32::DumpDebugInfo()
|
||||
SearchForDebugInfo();
|
||||
}
|
||||
|
||||
void ArchHooks_Win32::MessageBoxOK( CString sMessage )
|
||||
{
|
||||
MessageBox(NULL, sMessage, "StepMania", MB_OK );
|
||||
}
|
||||
|
||||
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnore( CString sMessage )
|
||||
{
|
||||
switch( MessageBox(NULL, sMessage, "StepMania", MB_ABORTRETRYIGNORE ) )
|
||||
{
|
||||
case IDABORT: return abort;
|
||||
case IDRETRY: return retry;
|
||||
default: ASSERT(0);
|
||||
case IDIGNORE: return ignore;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002-2003 by the person(s) listed below. All rights reserved.
|
||||
*
|
||||
|
||||
@@ -9,6 +9,8 @@ public:
|
||||
void Log(CString str, bool important);
|
||||
void DumpDebugInfo();
|
||||
void AdditionalLog(CString str);
|
||||
void MessageBoxOK( CString sMessage );
|
||||
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage );
|
||||
};
|
||||
|
||||
#undef ARCH_HOOKS
|
||||
|
||||
Reference in New Issue
Block a user