]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/app.h
added a call for invalidating the dc setup on mac explicitely (needed in case of...
[wxWidgets.git] / include / wx / app.h
index ab9e88a562958d79a0e0a42e915ba7e5841edba3..d1825f18a6afd0c8e44c722c782cddd15ec633da 100644 (file)
@@ -61,7 +61,9 @@ class WXDLLEXPORT wxAppBase : public wxEvtHandler
 public:
     // the virtual functions which may/must be overridden in the derived class
     // -----------------------------------------------------------------------
-
+#ifdef __WXMAC_X__
+    virtual ~wxAppBase() {}  // Added min for Mac X
+#endif
         // called during the program initialization, returning FALSE from here
         // prevents the program from continuing - it's a good place to create
         // the top level program window and return TRUE.
@@ -169,7 +171,7 @@ public:
         // return the "main" top level window (if it hadn't been set previously
         // with SetTopWindow(), will return just some top level window and, if
         // there are none, will return NULL)
-    wxWindow *GetTopWindow() const
+    virtual wxWindow *GetTopWindow() const
     {
         if (m_topWindow)
             return m_topWindow;
@@ -370,7 +372,7 @@ public:
 // be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
 // code if required.
 
-#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__)
+#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || (defined(__WXMAC__) && defined(__UNIX__))
     #define IMPLEMENT_WXWIN_MAIN \
         extern int wxEntry( int argc, char *argv[] ); \
         int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
@@ -380,35 +382,18 @@ public:
         #define WXAPIENTRY WXFAR wxSTDCALL
     #endif
 
-    // Patch from Mumit Khan to allow DLL compilation under mingw. Note that
-    // this includes <windows.h> which is a bad thing because it prevents
-    // wxWindows to work with MFC, so for now I'm making this change for
-    // mingw/cygwin only (these don't work with MFC yet). GRG Mar/2000
-    #if defined(__GNUWIN32__)
-        #include <windows.h>
-        #include "wx/msw/winundef.h"
-
-        #define IMPLEMENT_WXWIN_MAIN \
-            extern "C" int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);\
-            int WINAPI WinMain(HINSTANCE hInstance, \
-                               HINSTANCE hPrevInstance,\
-                               LPSTR m_lpCmdLine, int nCmdShow )\
-            {\
-                return wxEntry((WXHINSTANCE) hInstance, \
-                               (WXHINSTANCE) hPrevInstance,\
-                               m_lpCmdLine, nCmdShow);\
-            }
-    #else
-        #define IMPLEMENT_WXWIN_MAIN \
-            int WXAPIENTRY WinMain(HINSTANCE hInstance, \
-                                   HINSTANCE hPrevInstance,\
-                                   LPSTR m_lpCmdLine, int nCmdShow )\
-            {\
-                return wxEntry((WXHINSTANCE) hInstance, \
-                               (WXHINSTANCE) hPrevInstance,\
-                               m_lpCmdLine, nCmdShow);\
-            }
-    #endif
+    #include <windows.h>
+    #include "wx/msw/winundef.h"
+
+    #define IMPLEMENT_WXWIN_MAIN \
+        extern "C" int WXAPIENTRY WinMain(HINSTANCE hInstance,\
+                                          HINSTANCE hPrevInstance,\
+                                          LPSTR m_lpCmdLine, int nCmdShow)\
+        {\
+            return wxEntry((WXHINSTANCE) hInstance,\
+                           (WXHINSTANCE) hPrevInstance,\
+                           m_lpCmdLine, nCmdShow);\
+        }
 #else
     #define IMPLEMENT_WXWIN_MAIN
 #endif