make sure that setting custom foreground works together with custom background too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-05-18 23:18:18 +00:00
parent 8b71723c30
commit 3d2f4457ad

View File

@@ -339,10 +339,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 +361,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;