]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/evtloop.cpp
fixing 64 bit value transfer
[wxWidgets.git] / src / os2 / evtloop.cpp
index b054bfce488b331ce75910771848b08c0fd354d6..4525143553750bee19667c0647d4936904e91b50 100644 (file)
@@ -365,3 +365,53 @@ bool wxGUIEventLoop::Dispatch()
 
     return true;
 }
+
+//
+// Yield to incoming messages
+//
+bool wxGUIEventLoop::YieldFor(long eventsToProcess)
+{
+    HAB vHab = 0;
+    QMSG vMsg;
+
+    //
+    // Disable log flushing from here because a call to wxYield() shouldn't
+    // normally result in message boxes popping up &c
+    //
+    wxLog::Suspend();
+
+    m_isInsideYield = true;
+    m_eventsToProcessInsideYield = eventsToProcess;
+
+    //
+    // We want to go back to the main message loop
+    // if we see a WM_QUIT. (?)
+    //
+    while (::WinPeekMsg(vHab, &vMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) && vMsg.msg != WM_QUIT)
+    {
+        // TODO: implement event filtering using the eventsToProcess mask
+
+#if wxUSE_THREADS
+        wxMutexGuiLeaveOrEnter();
+#endif // wxUSE_THREADS
+        if (!wxTheApp->Dispatch())
+            break;
+    }
+
+    //
+    // If they are pending events, we must process them.
+    //
+    if (wxTheApp)
+    {
+        wxTheApp->ProcessPendingEvents();
+       wxTheApp->HandleSockets();
+    }
+
+    //
+    // Let the logs be flashed again
+    //
+    wxLog::Resume();
+    m_isInsideYield = false;
+
+    return true;
+} // end of wxYield