added HandleEvent() to allow handle exceptions in event handlers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-17 23:30:53 +00:00
parent 6f054ac5e8
commit 883117d126

View File

@@ -141,6 +141,14 @@ public:
// crash.
virtual void OnFatalException() { }
#if wxUSE_EXCEPTIONS
// Called when an unhandled C++ exception occurs inside OnRun(): note that
// the exception type is lost by now, so if you really want to handle the
// exception you should override OnRun() and put a try/catch around
// MainLoop() call there
virtual void OnUnhandledException() { }
#endif // wxUSE_EXCEPTIONS
// Called from wxExit() function, should terminate the application a.s.a.p.
virtual void Exit();
@@ -239,6 +247,17 @@ public:
// had been already processed or won't be processed at all, respectively
virtual int FilterEvent(wxEvent& event);
#if wxUSE_EXCEPTIONS
// call the specified handler on the given object with the given event
//
// this method only exists to allow catching the exceptions thrown by any
// event handler, it would lead to an extra (useless) virtual function call
// if the exceptions were not used, so it doesn't even exist in that case
virtual void HandleEvent(wxEvtHandler *handler,
wxEventFunction func,
wxEvent& event) const;
#endif // wxUSE_EXCEPTIONS
// process all events in the wxPendingEvents list -- it is necessary to
// call this function to process posted events. This happens during each
// event loop iteration in GUI mode but if there is no main loop, it may be