]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/app.cpp
using Run of base class
[wxWidgets.git] / src / osx / carbon / app.cpp
index f24210f1ca93bbf80a63373b58fd4c23ca85318d..c8e358c18515cfd7d30e3525d9aa25d28b995cbf 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -401,14 +400,40 @@ void wxApp::MacReopenApp()
     }
 }
 
+#if wxOSX_USE_COCOA_OR_IPHONE
 void wxApp::OSXOnWillFinishLaunching()
 {
+    wxTheApp->OnInit();
 }
 
 void wxApp::OSXOnDidFinishLaunching()
 {
+    wxTheApp->OnLaunched();
+    wxEventLoopBase::SetActive(GetMainLoop());
 }
 
+void wxApp::OSXOnWillTerminate()
+{
+    wxCloseEvent event;
+    event.SetCanVeto(false);
+    wxTheApp->OnEndSession(event);
+    
+    wxGUIEventLoop* mainloop = dynamic_cast<wxGUIEventLoop*>(GetMainLoop());
+    if ( mainloop )
+        mainloop->OSXOnWillTerminate();
+    wxEventLoopBase::SetActive(NULL);
+
+    wxTheApp->OnExit();
+}
+
+bool wxApp::OSXOnShouldTerminate()
+{
+    wxCloseEvent event;
+    wxTheApp->OnQueryEndSession(event);
+    return !event.GetVeto();
+}
+#endif
+
 //----------------------------------------------------------------------
 // Macintosh CommandID support - converting between native and wx IDs
 //----------------------------------------------------------------------