Fix build for gcc and wx < 3.1.6

This commit is contained in:
Jon Evans
2022-12-08 07:27:30 -05:00
parent 1fcdd94caf
commit 0a881e091c
2 changed files with 14 additions and 3 deletions
+13 -3
View File
@@ -36,6 +36,16 @@
static std::unordered_map<unsigned long, int> doNotShowAgainDlgs;
bool IsGUI()
{
#if wxCHECK_VERSION( 3, 1, 6 )
return wxTheApp->IsGUI();
#else
return dynamic_cast<wxAppBase*>( wxTheApp );
#endif
}
KIDIALOG::KIDIALOG( wxWindow* aParent, const wxString& aMessage, const wxString& aCaption,
long aStyle )
: wxRichMessageDialog( aParent, aMessage, aCaption, aStyle | wxCENTRE | wxSTAY_ON_TOP ),
@@ -286,7 +296,7 @@ void DisplayError( wxWindow* aParent, const wxString& aText, int aDisplayTime )
return;
}
if( !wxTheApp->IsGUI() )
if( !IsGUI() )
{
wxFprintf( stderr, aText );
return;
@@ -311,7 +321,7 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri
return;
}
if( !wxTheApp->IsGUI() )
if( !IsGUI() )
{
wxFprintf( stderr, aText );
return;
@@ -338,7 +348,7 @@ void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxSt
return;
}
if( !wxTheApp->IsGUI() )
if( !IsGUI() )
{
wxFprintf( stdout, "%s %s", aMessage, aExtraInfo );
return;
+1
View File
@@ -28,6 +28,7 @@
#include <wx/string.h>
#include <functional>
#include <list>
#include <map>
#include <unordered_map>