X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/903f1b0d80ed58ff7c0eb9e61e448640e3c214f4..a843caf3e1355f0fe21e2ee59c1385b58e347c02:/src/msw/control.cpp diff --git a/src/msw/control.cpp b/src/msw/control.cpp index ce27473f21..70451b1590 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "control.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -339,10 +335,6 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) { ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour())); } - else - { - ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT)); - } WXHBRUSH hbr = 0; if ( !colBg.Ok() ) @@ -365,6 +357,13 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID); hbr = (WXHBRUSH)brush->GetResourceHandle(); + + // if we use custom background, we should set foreground ourselves too + if ( !m_hasFgCol ) + { + ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT)); + } + //else: already set above } return hbr;