add wxAppConsoleBase::OnEventLoopEnter/Exit callbacks; add wxEventLoopBase::IsMain() and wxAppConsoleBase::GetMainLoop() helpers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-02-25 13:23:12 +00:00
parent 808f5a3aac
commit ec38d07d03
5 changed files with 87 additions and 4 deletions

View File

@@ -34,6 +34,28 @@ wxEventLoopBase::wxEventLoopBase()
m_eventsToProcessInsideYield = wxEVT_CATEGORY_ALL;
}
bool wxEventLoopBase::IsMain() const
{
if (wxTheApp)
return wxTheApp->GetMainLoop() == this;
return false;
}
/* static */
void wxEventLoopBase::SetActive(wxEventLoopBase* loop)
{
ms_activeLoop = loop;
if (wxTheApp)
wxTheApp->OnEventLoopEnter(loop);
}
void wxEventLoopBase::OnExit()
{
if (wxTheApp)
wxTheApp->OnEventLoopExit(this);
}
void wxEventLoopBase::DelayPendingEventHandler(wxEvtHandler* toDelay)
{
wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);