wxApp::DoYield => wxGUIEventLoop::YieldFor (part of r58911)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-02-15 23:18:04 +00:00
parent 0a949d7896
commit 8d60daa8d3
4 changed files with 93 additions and 123 deletions

View File

@@ -1117,60 +1117,6 @@ void wxCYield()
wxYield() ;
}
// Yield to other processes
bool wxApp::DoYield(bool onlyIfNeeded, long eventsToProcess)
{
#if wxUSE_THREADS
// Yielding from a non-gui thread needs to bail out, otherwise we end up
// possibly sending events in the thread too.
if ( !wxThread::IsMain() )
{
return true;
}
#endif // wxUSE_THREADS
if (m_isInsideYield)
{
if ( !onlyIfNeeded )
{
wxFAIL_MSG( wxT("wxYield called recursively" ) );
}
return false;
}
m_isInsideYield = true;
m_eventsToProcessInsideYield = eventsToProcess;
#if wxUSE_LOG
// disable log flushing from here because a call to wxYield() shouldn't
// normally result in message boxes popping up &c
wxLog::Suspend();
#endif // wxUSE_LOG
wxEventLoop * const
loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
if ( loop )
{
// process all pending events:
while ( loop->Pending() )
loop->Dispatch();
}
// it's necessary to call ProcessIdle() to update the frames sizes which
// might have been changed (it also will update other things set from
// OnUpdateUI() which is a nice (and desired) side effect)
while ( ProcessIdle() ) {}
#if wxUSE_LOG
wxLog::Resume();
#endif // wxUSE_LOG
m_isInsideYield = false;
return true;
}
// virtual
void wxApp::MacHandleUnhandledEvent( WXEVENTREF WXUNUSED(evr) )
{