Allow build without fatal exceptions support.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4d4edca33b
commit
b6b375a917
@ -110,7 +110,9 @@ public:
|
|||||||
void OnThrowUnhandled(wxCommandEvent& event);
|
void OnThrowUnhandled(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnCrash(wxCommandEvent& event);
|
void OnCrash(wxCommandEvent& event);
|
||||||
|
#if wxUSE_ON_FATAL_EXCEPTION
|
||||||
void OnHandleCrash(wxCommandEvent& event);
|
void OnHandleCrash(wxCommandEvent& event);
|
||||||
|
#endif
|
||||||
|
|
||||||
// 1st-level exception handling: we overload ProcessEvent() to be able to
|
// 1st-level exception handling: we overload ProcessEvent() to be able to
|
||||||
// catch exceptions which occur in MyFrame methods here
|
// catch exceptions which occur in MyFrame methods here
|
||||||
@ -161,12 +163,14 @@ class UnhandledException
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
// control ids and menu items
|
// control ids and menu items
|
||||||
Except_ThrowInt = 100,
|
Except_ThrowInt = wxID_HIGHEST,
|
||||||
Except_ThrowString,
|
Except_ThrowString,
|
||||||
Except_ThrowObject,
|
Except_ThrowObject,
|
||||||
Except_ThrowUnhandled,
|
Except_ThrowUnhandled,
|
||||||
Except_Crash,
|
Except_Crash,
|
||||||
|
#if wxUSE_ON_FATAL_EXCEPTION
|
||||||
Except_HandleCrash,
|
Except_HandleCrash,
|
||||||
|
#endif
|
||||||
Except_Dialog,
|
Except_Dialog,
|
||||||
|
|
||||||
Except_Quit = wxID_EXIT,
|
Except_Quit = wxID_EXIT,
|
||||||
@ -189,7 +193,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|||||||
EVT_MENU(Except_ThrowObject, MyFrame::OnThrowObject)
|
EVT_MENU(Except_ThrowObject, MyFrame::OnThrowObject)
|
||||||
EVT_MENU(Except_ThrowUnhandled, MyFrame::OnThrowUnhandled)
|
EVT_MENU(Except_ThrowUnhandled, MyFrame::OnThrowUnhandled)
|
||||||
EVT_MENU(Except_Crash, MyFrame::OnCrash)
|
EVT_MENU(Except_Crash, MyFrame::OnCrash)
|
||||||
|
#if wxUSE_ON_FATAL_EXCEPTION
|
||||||
EVT_MENU(Except_HandleCrash, MyFrame::OnHandleCrash)
|
EVT_MENU(Except_HandleCrash, MyFrame::OnHandleCrash)
|
||||||
|
#endif
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
||||||
@ -295,8 +301,10 @@ MyFrame::MyFrame()
|
|||||||
_T("Throw &unhandled exception\tCtrl-U"));
|
_T("Throw &unhandled exception\tCtrl-U"));
|
||||||
menuFile->Append(Except_Crash, _T("&Crash\tCtrl-C"));
|
menuFile->Append(Except_Crash, _T("&Crash\tCtrl-C"));
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
|
#if wxUSE_ON_FATAL_EXCEPTION
|
||||||
menuFile->AppendCheckItem(Except_HandleCrash, _T("&Handle crashes\tCtrl-H"));
|
menuFile->AppendCheckItem(Except_HandleCrash, _T("&Handle crashes\tCtrl-H"));
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
|
#endif
|
||||||
menuFile->Append(Except_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program"));
|
menuFile->Append(Except_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program"));
|
||||||
|
|
||||||
wxMenu *helpMenu = new wxMenu;
|
wxMenu *helpMenu = new wxMenu;
|
||||||
@ -380,11 +388,15 @@ void MyFrame::OnCrash(wxCommandEvent& WXUNUSED(event))
|
|||||||
DoCrash();
|
DoCrash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if wxUSE_ON_FATAL_EXCEPTION
|
||||||
|
|
||||||
void MyFrame::OnHandleCrash(wxCommandEvent& event)
|
void MyFrame::OnHandleCrash(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxHandleFatalExceptions(event.IsChecked());
|
wxHandleFatalExceptions(event.IsChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user