]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/toplvcmn.cpp
make wxConvUTF8 available in wchar_t-less mode, too
[wxWidgets.git] / src / common / toplvcmn.cpp
index 1f13c2535a89798f99dcaf1cb6380b45cae6f50d..23eaa3295b15a5af96762eed229c705e801c1bdb 100644 (file)
@@ -28,9 +28,9 @@
 #endif
 
 #ifndef WX_PRECOMP
-    #include "wx/app.h"
     #include "wx/toplevel.h"
     #include "wx/dcclient.h"
+    #include "wx/app.h"
 #endif // WX_PRECOMP
 
 // ----------------------------------------------------------------------------
@@ -46,10 +46,7 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-// FIXME: some platforms don't have wxTopLevelWindow yet
-#ifdef wxTopLevelWindowNative
-    IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow)
-#endif
+IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow)
 
 // ----------------------------------------------------------------------------
 // construction/destruction
@@ -86,12 +83,12 @@ bool wxTopLevelWindowBase::Destroy()
     return TRUE;
 }
 
-/* static */
-bool wxTopLevelWindowBase::IsLastBeforeExit()
+bool wxTopLevelWindowBase::IsLastBeforeExit() const
 {
     // we exit the application if there are no more top level windows left
     // normally but wxApp can prevent this from happening
-    return (wxTopLevelWindows.GetCount() == 1) &&
+    return wxTopLevelWindows.GetCount() == 1 &&
+            wxTopLevelWindows.GetFirst()->GetData() == (wxWindow *)this &&
             wxTheApp && wxTheApp->GetExitOnFrameDelete();
 }