moved OnExceptionInMainLoop() from wxAppConsole to wxAppBase because
1. console apps have no main loop 2. in non-monolithic mingw32 build, rethrowing an exception thrown from the GUI in the base DLL doesn't work git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,20 +116,6 @@ public:
|
|||||||
// crash.
|
// crash.
|
||||||
virtual void OnFatalException() { }
|
virtual void OnFatalException() { }
|
||||||
|
|
||||||
#if wxUSE_EXCEPTIONS
|
|
||||||
// function called if an uncaught exception is caught inside the main
|
|
||||||
// event loop: it may return true to continue running the event loop or
|
|
||||||
// false to stop it (in the latter case it may rethrow the exception as
|
|
||||||
// well)
|
|
||||||
virtual bool OnExceptionInMainLoop();
|
|
||||||
|
|
||||||
// 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.
|
// Called from wxExit() function, should terminate the application a.s.a.p.
|
||||||
virtual void Exit();
|
virtual void Exit();
|
||||||
|
|
||||||
@@ -237,6 +223,12 @@ public:
|
|||||||
virtual void HandleEvent(wxEvtHandler *handler,
|
virtual void HandleEvent(wxEvtHandler *handler,
|
||||||
wxEventFunction func,
|
wxEventFunction func,
|
||||||
wxEvent& event) const;
|
wxEvent& event) const;
|
||||||
|
|
||||||
|
// 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 or use OnExceptionInMainLoop()
|
||||||
|
virtual void OnUnhandledException() { }
|
||||||
#endif // wxUSE_EXCEPTIONS
|
#endif // wxUSE_EXCEPTIONS
|
||||||
|
|
||||||
// process all events in the wxPendingEvents list -- it is necessary to
|
// process all events in the wxPendingEvents list -- it is necessary to
|
||||||
@@ -430,8 +422,14 @@ public:
|
|||||||
// Returns true if more idle time is requested.
|
// Returns true if more idle time is requested.
|
||||||
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
|
virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event);
|
||||||
|
|
||||||
// Perform standard OnIdle behaviour: call from port's OnIdle
|
|
||||||
void OnIdle(wxIdleEvent& event);
|
#if wxUSE_EXCEPTIONS
|
||||||
|
// Function called if an uncaught exception is caught inside the main
|
||||||
|
// event loop: it may return true to continue running the event loop or
|
||||||
|
// false to stop it (in the latter case it may rethrow the exception as
|
||||||
|
// well)
|
||||||
|
virtual bool OnExceptionInMainLoop();
|
||||||
|
#endif // wxUSE_EXCEPTIONS
|
||||||
|
|
||||||
|
|
||||||
// top level window functions
|
// top level window functions
|
||||||
@@ -511,6 +509,9 @@ public:
|
|||||||
// returns true if the program is successfully initialized
|
// returns true if the program is successfully initialized
|
||||||
bool Initialized() { return true; }
|
bool Initialized() { return true; }
|
||||||
|
|
||||||
|
// perform standard OnIdle behaviour, ensure that this is always called
|
||||||
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// delete all objects in wxPendingDelete list
|
// delete all objects in wxPendingDelete list
|
||||||
|
@@ -320,17 +320,6 @@ wxAppConsole::HandleEvent(wxEvtHandler *handler,
|
|||||||
(handler->*func)(event);
|
(handler->*func)(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
wxAppConsole::OnExceptionInMainLoop()
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
|
|
||||||
// some compilers are too stupid to know that we never return after throw
|
|
||||||
#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200)
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // wxUSE_EXCEPTIONS
|
#endif // wxUSE_EXCEPTIONS
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -372,6 +372,10 @@ void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus))
|
|||||||
(void)ProcessEvent(event);
|
(void)ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// idle handling
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxAppBase::DeletePendingObjects()
|
void wxAppBase::DeletePendingObjects()
|
||||||
{
|
{
|
||||||
wxList::compatibility_iterator node = wxPendingDelete.GetFirst();
|
wxList::compatibility_iterator node = wxPendingDelete.GetFirst();
|
||||||
@@ -463,6 +467,24 @@ void wxAppBase::OnIdle(wxIdleEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// exceptions support
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if wxUSE_EXCEPTIONS
|
||||||
|
|
||||||
|
bool wxAppBase::OnExceptionInMainLoop()
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
|
||||||
|
// some compilers are too stupid to know that we never return after throw
|
||||||
|
#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_EXCEPTIONS
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxGUIAppTraitsBase
|
// wxGUIAppTraitsBase
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user