#endif
#ifndef WX_PRECOMP
+ #include "wx/window.h"
+ #include "wx/app.h"
#endif //WX_PRECOMP
#include "wx/evtloop.h"
-#include "wx/window.h"
-#include "wx/app.h"
#include "wx/tooltip.h"
#include "wx/msw/private.h"
WX_DECLARE_OBJARRAY(MSG, wxMsgArray);
// VS: this is a bit dirty - it duplicates same declaration in app.cpp
// (and there's no WX_DEFINE_OBJARRAY for that reason - it is already
- // defined in app.cpp).
+ // defined in app.cpp).
#endif
// ----------------------------------------------------------------------------
// wxEventLoop implementation
// ============================================================================
+wxEventLoop *wxEventLoop::ms_activeLoop = NULL;
+
// ----------------------------------------------------------------------------
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
m_impl = new wxEventLoopImpl;
+
+ wxEventLoop *oldLoop = ms_activeLoop;
+ ms_activeLoop = this;
for ( ;; )
{
delete m_impl;
m_impl = NULL;
+ ms_activeLoop = oldLoop;
+
return exitcode;
}
// leave out WM_COMMAND messages: too dangerous, sometimes
// the message will be processed twice
- if ( !wxIsWaitingForThread() ||
- msg.message != WM_COMMAND )
+ if ( !wxIsWaitingForThread() || msg.message != WM_COMMAND )
{
s_aSavedMessages.Add(msg);
}