From b6b375a9178af71eacdb06965560bb8a56617176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 3 Mar 2005 19:46:15 +0000 Subject: [PATCH] Allow build without fatal exceptions support. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/except/except.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 7d1c9991eb..6dbdee3eb8 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -110,7 +110,9 @@ public: void OnThrowUnhandled(wxCommandEvent& event); void OnCrash(wxCommandEvent& event); +#if wxUSE_ON_FATAL_EXCEPTION void OnHandleCrash(wxCommandEvent& event); +#endif // 1st-level exception handling: we overload ProcessEvent() to be able to // catch exceptions which occur in MyFrame methods here @@ -161,12 +163,14 @@ class UnhandledException enum { // control ids and menu items - Except_ThrowInt = 100, + Except_ThrowInt = wxID_HIGHEST, Except_ThrowString, Except_ThrowObject, Except_ThrowUnhandled, Except_Crash, +#if wxUSE_ON_FATAL_EXCEPTION Except_HandleCrash, +#endif Except_Dialog, Except_Quit = wxID_EXIT, @@ -189,7 +193,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(Except_ThrowObject, MyFrame::OnThrowObject) EVT_MENU(Except_ThrowUnhandled, MyFrame::OnThrowUnhandled) EVT_MENU(Except_Crash, MyFrame::OnCrash) +#if wxUSE_ON_FATAL_EXCEPTION EVT_MENU(Except_HandleCrash, MyFrame::OnHandleCrash) +#endif END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyDialog, wxDialog) @@ -295,8 +301,10 @@ MyFrame::MyFrame() _T("Throw &unhandled exception\tCtrl-U")); menuFile->Append(Except_Crash, _T("&Crash\tCtrl-C")); menuFile->AppendSeparator(); +#if wxUSE_ON_FATAL_EXCEPTION menuFile->AppendCheckItem(Except_HandleCrash, _T("&Handle crashes\tCtrl-H")); menuFile->AppendSeparator(); +#endif menuFile->Append(Except_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program")); wxMenu *helpMenu = new wxMenu; @@ -380,11 +388,15 @@ void MyFrame::OnCrash(wxCommandEvent& WXUNUSED(event)) DoCrash(); } +#if wxUSE_ON_FATAL_EXCEPTION + void MyFrame::OnHandleCrash(wxCommandEvent& event) { wxHandleFatalExceptions(event.IsChecked()); } +#endif + void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg;