From e8e1149bd7154e04ad36100bfdcc0f81de9f1a89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 31 Jul 2003 10:11:28 +0000 Subject: [PATCH] make it possible to use wxConsoleApp in GUI build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 13 +++++-------- src/common/init.cpp | 6 +++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index 35d9b5d06e..31f27162cf 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -26,7 +26,7 @@ #include "wx/build.h" #include "wx/init.h" // we must declare wxEntry() -class WXDLLIMPEXP_CORE wxApp; +class WXDLLIMPEXP_BASE wxAppConsole; class WXDLLIMPEXP_BASE wxAppTraits; class WXDLLIMPEXP_BASE wxCmdLineParser; class WXDLLIMPEXP_BASE wxLog; @@ -37,7 +37,7 @@ class WXDLLIMPEXP_BASE wxMessageOutput; // ---------------------------------------------------------------------------- // the type of the function used to create a wxApp object on program start up -typedef wxApp* (*wxAppInitializerFunction)(); +typedef wxAppConsole* (*wxAppInitializerFunction)(); // ---------------------------------------------------------------------------- // constants @@ -512,10 +512,7 @@ protected: #include "wx/os2/app.h" #endif #else // !GUI - // can't use typedef because wxApp forward declared as a class - class WXDLLIMPEXP_BASE wxApp : public wxAppConsole - { - }; + typedef wxAppConsole wxApp; #endif // GUI/!GUI // ---------------------------------------------------------------------------- @@ -600,9 +597,9 @@ public: // Use this macro if you want to define your own main() or WinMain() function // and call wxEntry() from there. #define IMPLEMENT_APP_NO_MAIN(appname) \ - wxApp *wxCreateApp() \ + wxAppConsole *wxCreateApp() \ { \ - wxApp::CheckBuildOptions(wxBuildOptions()); \ + wxAppConsole::CheckBuildOptions(wxBuildOptions()); \ return new appname; \ } \ wxAppInitializer \ diff --git a/src/common/init.cpp b/src/common/init.cpp index bc304d3be8..32288fd1e3 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -245,7 +245,11 @@ bool wxEntryStart(int& argc, wxChar **argv) if ( fnCreate ) { // he did, try to create the custom wxApp object - app.Set((*fnCreate)()); + // + // NB: cast is needed because for the backwards-compatibility + // reasons wxTheApp is really a wxApp and not just + // wxAppConsole... + app.Set((wxApp*)(*fnCreate)()); } } -- 2.45.2