]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
extend wxXLocale with wxStrto[d,l,ul] functions; make wxXLocale::Init() a little...
[wxWidgets.git] / src / common / appbase.cpp
index a78e93d1d47c42776f266653f4a0363e0f157c77..111ff3c7afac4a95e3057e26cf591199c1bf3871 100644 (file)
@@ -132,6 +132,7 @@ wxAppConsoleBase::wxAppConsoleBase()
 {
     m_traits = NULL;
     m_mainLoop = NULL;
+    m_bDoPendingEventProcessing = true;
 
     ms_appInstance = static_cast<wxAppConsole *>(this);
 
@@ -415,17 +416,19 @@ bool wxAppConsoleBase::HasPendingEvents() const
 
 void wxAppConsoleBase::SuspendProcessingOfPendingEvents()
 {
-    wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);
-        // entering the critical section locks blocks calls to ProcessPendingEvents()
+    m_bDoPendingEventProcessing = false;
 }
 
 void wxAppConsoleBase::ResumeProcessingOfPendingEvents()
 {
-    wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker);
+    m_bDoPendingEventProcessing = true;
 }
 
 void wxAppConsoleBase::ProcessPendingEvents()
 {
+    if (!m_bDoPendingEventProcessing)
+        return;
+
     wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);
 
     wxCHECK_RET( m_handlersWithPendingDelayedEvents.IsEmpty(),
@@ -462,6 +465,21 @@ void wxAppConsoleBase::ProcessPendingEvents()
     wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker);
 }
 
+void wxAppConsoleBase::DeletePendingEvents()
+{
+    wxENTER_CRIT_SECT(m_handlersWithPendingEventsLocker);
+
+    wxCHECK_RET( m_handlersWithPendingDelayedEvents.IsEmpty(),
+                 "this helper list should be empty" );
+
+    for (unsigned int i=0; i<m_handlersWithPendingEvents.GetCount(); i++)
+        m_handlersWithPendingEvents[i]->DeletePendingEvents();
+
+    m_handlersWithPendingEvents.Clear();
+
+    wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker);
+}
+
 // ----------------------------------------------------------------------------
 // exception handling
 // ----------------------------------------------------------------------------