]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
ensure that we don't get stuck in modal loop forever (part of patch 649438)
[wxWidgets.git] / src / msw / dc.cpp
index 190526870a23c07916285f508b3ae16736b253b2..a795a51b5e0f52b20a7a0fd6b8d23fbd4d4acfdf 100644 (file)
@@ -1399,40 +1399,9 @@ void wxDC::SetBackground(const wxBrush& brush)
 
     m_backgroundBrush = brush;
 
-    if (!m_backgroundBrush.Ok())
-        return;
-
-    if (m_canvas)
-    {
-        bool customColours = TRUE;
-        // If we haven't specified wxUSER_COLOURS, don't allow the panel/dialog box to
-        // change background colours from the control-panel specified colours.
-        if (m_canvas->IsKindOf(CLASSINFO(wxWindow)) && ((m_canvas->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
-            customColours = FALSE;
-
-        if (customColours)
-        {
-            if (m_backgroundBrush.GetStyle()==wxTRANSPARENT)
-            {
-                m_canvas->SetTransparent(TRUE);
-            }
-            else
-            {
-                // New behaviour, 10/2/99: setting the background brush of a DC
-                // doesn't affect the window background colour. However,
-                // I'm leaving in the transparency setting because it's needed by
-                // various controls (e.g. wxStaticText) to determine whether to draw
-                // transparently or not. TODO: maybe this should be a new function
-                // wxWindow::SetTransparency(). Should that apply to the child itself, or the
-                // parent?
-                //        m_canvas->SetBackgroundColour(m_backgroundBrush.GetColour());
-                m_canvas->SetTransparent(FALSE);
-            }
-        }
-    }
-    COLORREF new_color = m_backgroundBrush.GetColour().GetPixel();
+    if ( m_backgroundBrush.Ok() )
     {
-        (void)SetBkColor(GetHdc(), new_color);
+        (void)SetBkColor(GetHdc(), m_backgroundBrush.GetColour().GetPixel());
     }
 }
 
@@ -2280,7 +2249,7 @@ static bool AlphaBlt(HDC hdcDst,
     wxASSERT_MSG( hdcDst && hdcSrc, _T("AlphaBlt(): invalid HDC") );
 
     // do we have AlphaBlend() and company in the headers?
-#ifdef AC_SRC_OVER
+#if defined(AC_SRC_OVER) && wxUSE_DYNLIB_CLASS
     // yes, now try to see if we have it during run-time
     typedef BOOL (WINAPI *AlphaBlend_t)(HDC,int,int,int,int,
                                         HDC,int,int,int,int,