]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
smoother time estimation updates in wxProgressDialog (patch 992813)
[wxWidgets.git] / src / msw / app.cpp
index 688ca701e25130ed758c43258032a42504f67c0e..bcbe186896958c81903345463ae4909ec1e29836 100644 (file)
@@ -185,7 +185,7 @@ void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig)
 {
     wxEndBusyCursor();
 
-    const ChildWaitLoopData * const data = (ChildWaitLoopData *)dataOrig;
+    ChildWaitLoopData * const data = (ChildWaitLoopData *)dataOrig;
 
     delete data->wd;
 
@@ -193,6 +193,9 @@ void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig)
     // the other windows reenabled, the activation is going to return to the
     // window which had had it before
     data->winActive->Destroy();
+
+    // also delete the temporary data object itself
+    delete data;
 }
 
 bool wxGUIAppTraits::DoMessageFromThreadWait()
@@ -290,7 +293,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
          MB_ICONERROR | MB_OK
         );
 
-        return FALSE;
+        return false;
     }
 #endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU
 
@@ -343,7 +346,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
 
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
-    wxSetKeyboardHook(TRUE);
+    wxSetKeyboardHook(true);
 #endif
 
     callBaseCleanup.Dismiss();
@@ -430,7 +433,7 @@ bool wxApp::RegisterWindowClasses()
         wxLogLastError(wxT("RegisterClass(no redraw MDI child)"));
     }
 
-    return TRUE;
+    return true;
 }
 
 // ---------------------------------------------------------------------------
@@ -439,7 +442,7 @@ bool wxApp::RegisterWindowClasses()
 
 bool wxApp::UnregisterWindowClasses()
 {
-    bool retval = TRUE;
+    bool retval = true;
 
 #ifndef __WXMICROWIN__
     // MDI frame window class.
@@ -447,7 +450,7 @@ bool wxApp::UnregisterWindowClasses()
     {
         wxLogLastError(wxT("UnregisterClass(MDI parent)"));
 
-        retval = FALSE;
+        retval = false;
     }
 
     // "no redraw" MDI frame
@@ -455,7 +458,7 @@ bool wxApp::UnregisterWindowClasses()
     {
         wxLogLastError(wxT("UnregisterClass(no redraw MDI parent frame)"));
 
-        retval = FALSE;
+        retval = false;
     }
 
     // MDI child frame window class.
@@ -463,7 +466,7 @@ bool wxApp::UnregisterWindowClasses()
     {
         wxLogLastError(wxT("UnregisterClass(MDI child)"));
 
-        retval = FALSE;
+        retval = false;
     }
 
     // "no redraw" MDI child frame
@@ -471,7 +474,7 @@ bool wxApp::UnregisterWindowClasses()
     {
         wxLogLastError(wxT("UnregisterClass(no redraw MDI child)"));
 
-        retval = FALSE;
+        retval = false;
     }
 
     // canvas class name
@@ -479,14 +482,14 @@ bool wxApp::UnregisterWindowClasses()
     {
         wxLogLastError(wxT("UnregisterClass(canvas)"));
 
-        retval = FALSE;
+        retval = false;
     }
 
     if ( !::UnregisterClass(wxCanvasClassNameNR, wxhInstance) )
     {
         wxLogLastError(wxT("UnregisterClass(no redraw canvas)"));
 
-        retval = FALSE;
+        retval = false;
     }
 #endif // __WXMICROWIN__
 
@@ -502,7 +505,7 @@ void wxApp::CleanUp()
     wxAppBase::CleanUp();
 
 #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
-    wxSetKeyboardHook(FALSE);
+    wxSetKeyboardHook(false);
 #endif
 
 #if wxUSE_PENWINDOWS
@@ -604,7 +607,7 @@ void wxApp::WakeUpIdle()
 void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
 {
     if (GetTopWindow())
-        GetTopWindow()->Close(TRUE);
+        GetTopWindow()->Close(true);
 }
 
 // Default behaviour: close the application with prompts. The
@@ -614,7 +617,7 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event)
     if (GetTopWindow())
     {
         if (!GetTopWindow()->Close(!event.CanVeto()))
-            event.Veto(TRUE);
+            event.Veto(true);
     }
 }
 
@@ -625,8 +628,7 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event)
 /* static */
 int wxApp::GetComCtl32Version()
 {
-//FIX ME FOR DIGITALMARS!!
-#if defined(__WXMICROWIN__) || defined(__WXWINCE__) || defined(__DIGITALMARS__)
+#if defined(__WXMICROWIN__) || defined(__WXWINCE__)
     return 0;
 #else
     // cache the result
@@ -713,7 +715,7 @@ int wxApp::GetComCtl32Version()
 bool wxApp::Yield(bool onlyIfNeeded)
 {
     // MT-FIXME
-    static bool s_inYield = FALSE;
+    static bool s_inYield = false;
 
 #if wxUSE_LOG
     // disable log flushing from here because a call to wxYield() shouldn't
@@ -728,10 +730,10 @@ bool wxApp::Yield(bool onlyIfNeeded)
             wxFAIL_MSG( wxT("wxYield called recursively" ) );
         }
 
-        return FALSE;
+        return false;
     }
 
-    s_inYield = TRUE;
+    s_inYield = true;
 
     // we don't want to process WM_QUIT from here - it should be processed in
     // the main event loop in order to stop it
@@ -755,9 +757,9 @@ bool wxApp::Yield(bool onlyIfNeeded)
     wxLog::Resume();
 #endif // wxUSE_LOG
 
-    s_inYield = FALSE;
+    s_inYield = false;
 
-    return TRUE;
+    return true;
 }
 
 #if wxUSE_EXCEPTIONS
@@ -800,3 +802,33 @@ terminate the program,\r\n\
 }
 
 #endif // wxUSE_EXCEPTIONS
+
+// ----------------------------------------------------------------------------
+// deprecated event loop functions
+// ----------------------------------------------------------------------------
+
+#if WXWIN_COMPATIBILITY_2_4
+
+#include "wx/evtloop.h"
+
+void wxApp::DoMessage(WXMSG *pMsg)
+{
+    wxEventLoop *evtLoop = wxEventLoop::GetActive();
+    if ( evtLoop )
+        evtLoop->ProcessMessage(pMsg);
+}
+
+bool wxApp::DoMessage()
+{
+    wxEventLoop *evtLoop = wxEventLoop::GetActive();
+    return evtLoop ? evtLoop->Dispatch() : false;
+}
+
+bool wxApp::ProcessMessage(WXMSG* pMsg)
+{
+    wxEventLoop *evtLoop = wxEventLoop::GetActive();
+    return evtLoop && evtLoop->PreProcessMessage(pMsg);
+}
+
+#endif // WXWIN_COMPATIBILITY_2_4
+