]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/app.h
Preserve size of wxGrid rows/columns when hiding and showing them back.
[wxWidgets.git] / include / wx / app.h
index 3787654e9ec639bb9d6d060380a4762ef916dd61..fbd85a78397ec446e1ab061cde017e94322e7f9b 100644 (file)
@@ -494,7 +494,7 @@ protected:
     wxDECLARE_NO_COPY_CLASS(wxAppConsoleBase);
 };
 
-#if defined(__UNIX__) && !defined(__CYGWIN__)
+#if defined(__UNIX__) && !defined(__WXMSW__)
     #include "wx/unix/app.h"
 #else
     // this has to be a class and not a typedef as we forward declare it
@@ -766,13 +766,26 @@ public:
 // your compiler really, really wants main() to be in your main program (e.g.
 // hello.cpp). Now wxIMPLEMENT_APP should add this code if required.
 
-#define wxIMPLEMENT_WXWIN_MAIN_CONSOLE                                        \
-    int main(int argc, char **argv)                                           \
-    {                                                                         \
-        wxDISABLE_DEBUG_SUPPORT();                                            \
+// For compilers that support it, prefer to use wmain() as this ensures any
+// Unicode strings can be passed as command line parameters and not just those
+// representable in the current locale.
+#if wxUSE_UNICODE && defined(__VISUALC__)
+    #define wxIMPLEMENT_WXWIN_MAIN_CONSOLE                                    \
+        int wmain(int argc, wchar_t **argv)                                   \
+        {                                                                     \
+            wxDISABLE_DEBUG_SUPPORT();                                        \
                                                                               \
-        return wxEntry(argc, argv);                                           \
-    }
+            return wxEntry(argc, argv);                                       \
+        }
+#else // Use standard main()
+    #define wxIMPLEMENT_WXWIN_MAIN_CONSOLE                                    \
+        int main(int argc, char **argv)                                       \
+        {                                                                     \
+            wxDISABLE_DEBUG_SUPPORT();                                        \
+                                                                              \
+            return wxEntry(argc, argv);                                       \
+        }
+#endif
 
 // port-specific header could have defined it already in some special way
 #ifndef wxIMPLEMENT_WXWIN_MAIN
@@ -795,6 +808,7 @@ public:
 // Use this macro if you want to define your own main() or WinMain() function
 // and call wxEntry() from there.
 #define wxIMPLEMENT_APP_NO_MAIN(appname)                                    \
+    appname& wxGetApp() { return *static_cast<appname*>(wxApp::GetInstance()); }    \
     wxAppConsole *wxCreateApp()                                             \
     {                                                                       \
         wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE,         \
@@ -802,9 +816,7 @@ public:
         return new appname;                                                 \
     }                                                                       \
     wxAppInitializer                                                        \
-        wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp);        \
-    appname& wxGetApp() { return *static_cast<appname*>(wxApp::GetInstance()); }    \
-    wxDECLARE_APP(appname)
+        wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp)
 
 // Same as wxIMPLEMENT_APP() normally but doesn't include themes support in
 // wxUniversal builds