]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Deprecate wxPathExists, make wxDirExists used everywhere, minor source cleaning.
[wxWidgets.git] / src / msw / window.cpp
index 163c0df7ea012372749f0cbff4f4d716ef43c272..68136888e9a5bc3219772f966ea79570c5f9a597 100644 (file)
@@ -1297,7 +1297,8 @@ void wxWindowMSW::Freeze()
 {
     if ( !m_frozenness++ )
     {
-        SendSetRedraw(GetHwnd(), false);
+        if ( IsShown() )
+            SendSetRedraw(GetHwnd(), false);
     }
 }
 
@@ -1307,11 +1308,14 @@ void wxWindowMSW::Thaw()
 
     if ( !--m_frozenness )
     {
-        SendSetRedraw(GetHwnd(), true);
+        if ( IsShown() )
+        {
+            SendSetRedraw(GetHwnd(), true);
 
-        // we need to refresh everything or otherwise he invalidated area is not
-        // repainted
-        Refresh();
+            // we need to refresh everything or otherwise the invalidated area
+            // is not going to be repainted
+            Refresh();
+        }
     }
 }
 
@@ -1320,18 +1324,31 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
     HWND hWnd = GetHwnd();
     if ( hWnd )
     {
+        RECT mswRect;
+        const RECT *pRect;
         if ( rect )
         {
-            RECT mswRect;
             mswRect.left = rect->x;
             mswRect.top = rect->y;
             mswRect.right = rect->x + rect->width;
             mswRect.bottom = rect->y + rect->height;
 
-            ::InvalidateRect(hWnd, &mswRect, eraseBack);
+            pRect = &mswRect;
         }
         else
-            ::InvalidateRect(hWnd, NULL, eraseBack);
+        {
+            pRect = NULL;
+        }
+
+#ifndef __SMARTPHONE__
+        UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN;
+        if ( eraseBack )
+            flags |= RDW_ERASE;
+
+        ::RedrawWindow(hWnd, pRect, NULL, flags);
+#else
+        ::InvalidateRect(hWnd, pRect, eraseBack);
+#endif
     }
 }
 
@@ -1504,27 +1521,22 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
     if (height < 0)
         height = 0;
 
-    HDWP hdwp = 0;
-    
-    if ( wxSystemOptions::GetOptionInt(wxT("msw.window.defersize")) == 1 )
+    // if our parent had prepared a defer window handle for us, use it (unless
+    // we are a top level window)
+    wxWindowMSW *parent = GetParent();
+    HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL;
+    if ( hdwp )
     {
-        // if our parent had prepared a defer window handle for us, use it (unless
-        // we are a top level window)
-        wxWindowMSW *parent = GetParent();
-        hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL;
-        if ( hdwp )
+        hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
+                            x, y, width, height,
+                            SWP_NOZORDER);
+        if ( !hdwp )
         {
-            hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
-                                x, y, width, height,
-                                SWP_NOZORDER);
-            if ( !hdwp )
-            {
-                wxLogLastError(_T("DeferWindowPos"));
-            }
-
-            // hdwp must be updated as it may have been changed
-            parent->m_hDWP = (WXHANDLE)hdwp;
+            wxLogLastError(_T("DeferWindowPos"));
         }
+
+        // hdwp must be updated as it may have been changed
+        parent->m_hDWP = (WXHANDLE)hdwp;
     }
 
     // otherwise (or if deferring failed) move the window in place immediately
@@ -4110,13 +4122,10 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
     const int numChildren = GetChildren().GetCount();
     if ( numChildren > 1 )
     {
-        if ( wxSystemOptions::GetOptionInt(wxT("msw.window.defersize")) == 1 )
+        m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
+        if ( !m_hDWP )
         {
-            m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
-            if ( !m_hDWP )
-            {
-                wxLogLastError(_T("BeginDeferWindowPos"));
-            }
+            wxLogLastError(_T("BeginDeferWindowPos"));
         }
     }