added wxLog::Suspend/Resume and wxYield() uses them now so that it won't flush

the messages any more


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-22 10:00:29 +00:00
parent 6daa30a07e
commit 2ed3265e18
5 changed files with 45 additions and 15 deletions

View File

@@ -1019,9 +1019,7 @@ void wxApp::OnIdle(wxIdleEvent& event)
#if wxUSE_LOG
// flush the logged messages if any
wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->HasPendingMessages() )
pLog->Flush();
wxLog::FlushActive();
#endif // wxUSE_LOG
// Send OnIdle events to all windows
@@ -1216,9 +1214,12 @@ void wxExit()
// Yield to incoming messages
bool wxYield()
{
// disable log flushing from here because a call to wxYield() shouldn't
// normally result in message boxes popping up &c
wxLog::Suspend();
// we don't want to process WM_QUIT from here - it should be processed in
// the main event loop in order to stop it
MSG msg;
while ( PeekMessage(&msg, (HWND)0, 0, 0, PM_NOREMOVE) &&
msg.message != WM_QUIT )
@@ -1234,6 +1235,9 @@ bool wxYield()
// If they are pending events, we must process them.
wxTheApp->ProcessPendingEvents();
// let the logs be flashed again
wxLog::Resume();
return TRUE;
}