]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
corrected setting the locale of the c-lib for mac
[wxWidgets.git] / src / msw / window.cpp
index afd85c77ac291d8256269857f568c4ed6cdf3f3a..21055bce766c8bcb0d7fabb2c5b27fc5e7af5aa8 100644 (file)
@@ -437,7 +437,6 @@ void wxWindowMSW::Init()
     m_frozenness = 0;
 
     m_hWnd = 0;
-    m_hDWP = 0;
 
     m_xThumbSize = 0;
     m_yThumbSize = 0;
@@ -1532,29 +1531,9 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
     if (height < 0)
         height = 0;
 
-    // if our parent had prepared a defer window handle for us, use it
-    HDWP hdwp = m_parent ? (HDWP)m_parent->m_hDWP : NULL;
-    if ( hdwp )
+    if ( !::MoveWindow(GetHwnd(), x, y, width, height, TRUE) )
     {
-        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
-        m_parent->m_hDWP = (WXHANDLE)hdwp;
-    }
-
-    // otherwise (or if deferring failed) move the window in place immediately
-    if ( !hdwp )
-    {
-        if ( !::MoveWindow(GetHwnd(), x, y, width, height, TRUE) )
-        {
-            wxLogLastError(wxT("MoveWindow"));
-        }
+        wxLogLastError(wxT("MoveWindow"));
     }
 }
 
@@ -2248,36 +2227,8 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
             (void)HandleDestroy();
             break;
 
-        case WM_WINDOWPOSCHANGING:
-            {
-                // when we resize this window, its children are probably going
-                // to be repositioned as well, prepare to use DeferWindowPos()
-                // for them
-                const int numChildren = GetChildren().GetCount();
-                if ( numChildren > 1 )
-                {
-                    m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
-                    if ( !m_hDWP )
-                    {
-                        wxLogLastError(_T("BeginDeferWindowPos"));
-                    }
-                }
-            }
-            break;
-
         case WM_SIZE:
             processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
-
-            if ( m_hDWP )
-            {
-                // put all child controls in place at once now
-                if ( !::EndDeferWindowPos((HDWP)m_hDWP) )
-                {
-                    wxLogLastError(_T("EndDeferWindowPos"));
-                }
-
-                m_hDWP = NULL;
-            }
             break;
 
         case WM_MOVE:
@@ -4097,9 +4048,11 @@ WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
     return 0;
 }
 
-wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow * WXUNUSED(child))
+wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow *child)
 {
-    return m_inheritBgCol ? GetBackgroundColour() : wxNullColour;
+    return m_inheritBgCol || (m_hasBgCol && child == this)
+                ? GetBackgroundColour()
+                : wxNullColour;
 }
 
 WXHBRUSH wxWindowMSW::MSWGetBgBrushForSelf(wxWindow *parent, WXHDC hDC)
@@ -4116,8 +4069,11 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC)
             return hBrush;
 
         // background is not inherited beyond the windows which have their own
-        // fixed background such as top level windows and notebooks
-        if ( win->ProvidesBackground() )
+        // fixed background such as top level windows and notebooks and for
+        // windows for which a custom colour had been explicitly set with
+        // SetOwnBackgroundColour() and so shouldn't affect its children
+        if ( win->ProvidesBackground() ||
+                (win->m_hasBgCol && !win->m_inheritBgCol) )
             break;
     }