fix dialog windows coming up in fullscreen
This commit is contained in:
Glenn Maynard
2004-01-13 00:15:10 +00:00
parent 13c4103e62
commit 4ab53741d9
4 changed files with 29 additions and 15 deletions
@@ -26,10 +26,19 @@ void ArchHooks::IgnoreMessage( CString ID )
PREFSMAN->m_sIgnoredMessageWindows = join( ",", list );
PREFSMAN->SaveGlobalPrefsToDisk();
}
#include "RageLog.h"
void ArchHooks::MessageBoxError( CString sMessage )
{
MessageBoxErrorPrivate( sMessage );
}
void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return;
// don't show MessageBox if windowed
if(LOG)LOG->Trace("wind %i", DISPLAY->IsWindowed());
if( !DISPLAY->IsWindowed() )
ArchHooks::MessageBoxOKPrivate( sMessage, ID );
else
@@ -38,6 +47,9 @@ void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
// don't show MessageBox if windowed
if( DISPLAY && !DISPLAY->IsWindowed() )
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
@@ -47,6 +59,9 @@ ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMess
ArchHooks::MessageBoxResult ArchHooks::MessageBoxRetryCancel( CString sMessage, CString ID )
{
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
// don't show MessageBox if windowed
if( !DISPLAY->IsWindowed() )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
+6 -5
View File
@@ -28,12 +28,12 @@ public:
/* Message box stuff. Not supported on all archs. The ID can be used
* to identify a class of messages, for "don't display this dialog"-type
* prompts. */
* prompts. (Don't overload these, overload *Private below.) */
enum MessageBoxResult { abort, retry, ignore, cancel };
virtual void MessageBoxError( CString error ) { printf("Error: %s\n", error.c_str()); }
virtual void MessageBoxOK( CString sMessage, CString ID = "" );
virtual MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID = "" );
virtual MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID = "" );
void MessageBoxError( CString error );
void MessageBoxOK( CString sMessage, CString ID = "" );
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID = "" );
MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID = "" );
virtual ~ArchHooks() { }
/* This is called once each time through the game loop */
@@ -43,6 +43,7 @@ public:
virtual void RestartProgram() { }
protected:
virtual void MessageBoxErrorPrivate( CString sMessage ) { printf("Error: %s\n", sMessage.c_str()); }
virtual void MessageBoxOKPrivate( CString sMessage, CString ID ) {}
virtual MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID ) { return ignore; }
virtual MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID ) { return cancel; }
@@ -72,11 +72,9 @@ static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
void ArchHooks_Win32::MessageBoxOK( CString sMessage, CString ID )
void ArchHooks_Win32::MessageBoxOKPrivate( CString sMessage, CString ID )
{
g_AllowHush = ID != "";
if( g_AllowHush && MessageIsIgnored( ID ) )
return;
g_sMessage = sMessage;
AppInstance handle;
DialogBox(handle.Get(), MAKEINTRESOURCE(IDD_OK), NULL, OKWndProc);
@@ -147,7 +145,7 @@ static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
return FALSE;
}
void ArchHooks_Win32::MessageBoxError( CString error )
void ArchHooks_Win32::MessageBoxErrorPrivate( CString error )
{
g_sErrorString = error;
// throw up a pretty error dialog
@@ -156,7 +154,7 @@ void ArchHooks_Win32::MessageBoxError( CString error )
NULL, ErrorWndProc);
}
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID )
{
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_ABORTRETRYIGNORE|MB_DEFBUTTON2 ) )
{
@@ -167,7 +165,7 @@ ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnore( CString
}
}
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxRetryCancel( CString sMessage, CString ID )
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxRetryCancelPrivate( CString sMessage, CString ID )
{
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_RETRYCANCEL ) )
{
@@ -7,10 +7,10 @@ class ArchHooks_Win32: public ArchHooks
public:
ArchHooks_Win32();
void DumpDebugInfo();
void MessageBoxOK( CString sMessage, CString ID );
void MessageBoxError( CString error );
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID );
MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID );
void MessageBoxOKPrivate( CString sMessage, CString ID );
void MessageBoxErrorPrivate( CString error );
MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID );
MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID );
void RestartProgram();
};