second part of #10320: move wxApp event handling functions to wxEventLoopBase (in particular move Yield() functions); add backward compatible redirections to wxApp; update docs; remove global lists wxPendingEvents and wxPendingEventsLocker

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-02-15 14:25:08 +00:00
parent 145bbf1fdf
commit dde19c2180
50 changed files with 1104 additions and 1070 deletions

View File

@@ -40,6 +40,7 @@
#include "wx/msgout.h"
#include "wx/thread.h"
#include "wx/vidmode.h"
#include "wx/evtloop.h"
#ifdef __WXDEBUG__
#if wxUSE_STACKWALKER
@@ -78,9 +79,6 @@ wxAppBase::wxAppBase()
m_isActive = true;
m_isInsideYield = false;
m_eventsToProcessInsideYield = wxEVT_CATEGORY_ALL;
// We don't want to exit the app if the user code shows a dialog from its
// OnInit() -- but this is what would happen if we set m_exitOnFrameDelete
// to Yes initially as this dialog would be the last top level window.
@@ -326,23 +324,22 @@ void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus))
(void)ProcessEvent(event);
}
bool wxAppBase::IsEventAllowedInsideYield(wxEventCategory cat) const
{
return (m_eventsToProcessInsideYield & cat) != 0;
}
bool wxAppBase::SafeYield(wxWindow *win, bool onlyIfNeeded)
{
wxWindowDisabler wd(win);
return Yield(onlyIfNeeded);
wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
return loop && loop->Yield(onlyIfNeeded);
}
bool wxAppBase::SafeYieldFor(wxWindow *win, long eventsToProcess)
{
wxWindowDisabler wd(win);
return YieldFor(eventsToProcess);
wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
return loop && loop->YieldFor(eventsToProcess);
}