add MessageBox to ArchHooks to get rid of WIN32 #ifdefs

This commit is contained in:
Chris Danford
2003-07-04 22:45:53 +00:00
parent 2b54afeb77
commit 32c63c9429
3 changed files with 23 additions and 0 deletions
+5
View File
@@ -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