]> git.saurik.com Git - wxWidgets.git/commitdiff
make it possible to use wxConsoleApp in GUI build
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 31 Jul 2003 10:11:28 +0000 (10:11 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 31 Jul 2003 10:11:28 +0000 (10:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/app.h
src/common/init.cpp

index 35d9b5d06eb432f55798ce7acb0d55f2c5eff35b..31f27162cf2883d29d7217b377c9d6e260c91c05 100644 (file)
@@ -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                                                        \
index bc304d3be815a6be13d387ed77ae609d1653cecc..32288fd1e325fbcbc58fedcf72626754ff81d450 100644 (file)
@@ -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)());
         }
     }