Session management changes for wxMSW.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-10-12 19:45:24 +00:00
parent 03f38c58fd
commit 387a3b02e0
15 changed files with 317 additions and 73 deletions

View File

@@ -97,6 +97,8 @@ LRESULT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxApp::OnIdle)
EVT_END_SESSION(wxApp::OnEndSession)
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
END_EVENT_TABLE()
#endif
@@ -892,6 +894,23 @@ void wxApp::DeletePendingObjects()
}
}
void wxApp::OnEndSession(wxCloseEvent& event)
{
if (GetTopWindow())
GetTopWindow()->Close(TRUE);
}
// Default behaviour: close the application with prompts. The
// user can veto the close, and therefore the end session.
void wxApp::OnQueryEndSession(wxCloseEvent& event)
{
if (GetTopWindow())
{
if (!GetTopWindow()->Close(!event.CanVeto()))
event.Veto(TRUE);
}
}
wxLog* wxApp::CreateLogTarget()
{
return new wxLogGui;