further routing into wxApp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -146,7 +146,11 @@ public:
|
|||||||
virtual void OSXOnWillFinishLaunching();
|
virtual void OSXOnWillFinishLaunching();
|
||||||
// immediately when the native event loop starts, no events have been served yet
|
// immediately when the native event loop starts, no events have been served yet
|
||||||
virtual void OSXOnDidFinishLaunching();
|
virtual void OSXOnDidFinishLaunching();
|
||||||
|
// OS asks to terminate app, return no to stay running
|
||||||
|
virtual bool OSXOnShouldTerminate();
|
||||||
|
// before application terminates
|
||||||
|
virtual void OSXOnWillTerminate();
|
||||||
|
|
||||||
// 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.
|
||||||
void MacHideApp();
|
void MacHideApp();
|
||||||
|
|
||||||
|
@@ -407,6 +407,21 @@ void wxApp::OSXOnWillFinishLaunching()
|
|||||||
|
|
||||||
void wxApp::OSXOnDidFinishLaunching()
|
void wxApp::OSXOnDidFinishLaunching()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxApp::OSXOnWillTerminate()
|
||||||
|
{
|
||||||
|
wxCloseEvent event;
|
||||||
|
event.SetCanVeto(false);
|
||||||
|
wxTheApp->OnEndSession(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxApp::OSXOnShouldTerminate()
|
||||||
|
{
|
||||||
|
wxCloseEvent event;
|
||||||
|
wxTheApp->OnQueryEndSession(event);
|
||||||
|
return !event.GetVeto();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -126,9 +126,7 @@ void wxBell()
|
|||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||||
{
|
{
|
||||||
wxUnusedVar(sender);
|
wxUnusedVar(sender);
|
||||||
wxCloseEvent event;
|
if ( !wxTheApp->OSXOnShouldTerminate() )
|
||||||
wxTheApp->OnQueryEndSession(event);
|
|
||||||
if ( event.GetVeto() )
|
|
||||||
return NSTerminateCancel;
|
return NSTerminateCancel;
|
||||||
|
|
||||||
return NSTerminateNow;
|
return NSTerminateNow;
|
||||||
@@ -136,9 +134,7 @@ void wxBell()
|
|||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification *)application {
|
- (void)applicationWillTerminate:(NSNotification *)application {
|
||||||
wxUnusedVar(application);
|
wxUnusedVar(application);
|
||||||
wxCloseEvent event;
|
wxTheApp->OSXOnWillTerminate();
|
||||||
event.SetCanVeto(false);
|
|
||||||
wxTheApp->OnEndSession(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
|
||||||
|
Reference in New Issue
Block a user