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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user