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

@@ -365,3 +365,52 @@ bool wxGUIEventLoop::Dispatch()
return true;
}
//
// Yield to incoming messages
//
bool wxGUIEventLoop::YieldFor(long eventsToProcess)
{
HAB vHab = 0;
QMSG vMsg;
//
// Disable log flushing from here because a call to wxYield() shouldn't
// normally result in message boxes popping up &c
//
wxLog::Suspend();
m_isInsideYield = true;
m_eventsToProcessInsideYield = eventsToProcess;
//
// We want to go back to the main message loop
// if we see a WM_QUIT. (?)
//
while (::WinPeekMsg(vHab, &vMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) && vMsg.msg != WM_QUIT)
{
// TODO: implement event filtering using the eventsToProcess mask
#if wxUSE_THREADS
wxMutexGuiLeaveOrEnter();
#endif // wxUSE_THREADS
if (!wxTheApp->Dispatch())
break;
}
//
// If they are pending events, we must process them.
//
if (wxTheApp)
wxTheApp->ProcessPendingEvents();
HandleSockets();
//
// Let the logs be flashed again
//
wxLog::Resume();
m_isInsideYield = false;
return true;
} // end of wxYield