adapting to new event version

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2013-07-28 14:52:47 +00:00
parent 17243986ec
commit f7105c8fe2
3 changed files with 8 additions and 15 deletions

View File

@@ -150,6 +150,12 @@ public:
virtual bool OSXOnShouldTerminate(); virtual bool OSXOnShouldTerminate();
// before application terminates // before application terminates
virtual void OSXOnWillTerminate(); virtual void OSXOnWillTerminate();
private:
bool m_onInitResult;
public:
#endif #endif
// Hide the application windows the same as the system hide command would do it. // Hide the application windows the same as the system hide command would do it.

View File

@@ -324,12 +324,8 @@ int wxAppConsoleBase::MainLoop()
{ {
wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop()); wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop());
#if defined(__WXOSX__) && wxOSX_USE_COCOA_OR_IPHONE
// OnLaunched called from native app controller
#else
if (wxTheApp) if (wxTheApp)
wxTheApp->OnLaunched(); wxTheApp->OnLaunched();
#endif
return m_mainLoop ? m_mainLoop->Run() : -1; return m_mainLoop ? m_mainLoop->Run() : -1;
} }

View File

@@ -403,13 +403,11 @@ void wxApp::MacReopenApp()
#if wxOSX_USE_COCOA_OR_IPHONE #if wxOSX_USE_COCOA_OR_IPHONE
void wxApp::OSXOnWillFinishLaunching() void wxApp::OSXOnWillFinishLaunching()
{ {
wxTheApp->OnInit(); m_onInitResult = OnInit();
} }
void wxApp::OSXOnDidFinishLaunching() void wxApp::OSXOnDidFinishLaunching()
{ {
wxTheApp->OnLaunched();
wxEventLoopBase::SetActive(GetMainLoop());
} }
void wxApp::OSXOnWillTerminate() void wxApp::OSXOnWillTerminate()
@@ -417,13 +415,6 @@ void wxApp::OSXOnWillTerminate()
wxCloseEvent event; wxCloseEvent event;
event.SetCanVeto(false); event.SetCanVeto(false);
wxTheApp->OnEndSession(event); wxTheApp->OnEndSession(event);
wxGUIEventLoop* mainloop = dynamic_cast<wxGUIEventLoop*>(GetMainLoop());
if ( mainloop )
mainloop->OSXOnWillTerminate();
wxEventLoopBase::SetActive(NULL);
wxTheApp->OnExit();
} }
bool wxApp::OSXOnShouldTerminate() bool wxApp::OSXOnShouldTerminate()
@@ -896,7 +887,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
return true; return true;
} }
#if wxOSX_USE_COCOA_OR_CARBON #if wxOSX_USE_CARBON
bool wxApp::CallOnInit() bool wxApp::CallOnInit()
{ {
wxMacAutoreleasePool autoreleasepool; wxMacAutoreleasePool autoreleasepool;