keep correct default background but allow overriding it in user code too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-05-31 14:52:23 +00:00
parent 123865f20a
commit 0cf1199546
2 changed files with 10 additions and 12 deletions

View File

@ -57,10 +57,11 @@ public:
virtual bool MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
protected:
// override wxControl version to not use solid background here
virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd);
virtual WXHBRUSH DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd);
wxSize DoGetBestSize() const;
protected:
virtual wxSize DoGetBestSize() const;
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
int m_pageSize;

View File

@ -344,16 +344,13 @@ WXDWORD wxScrollBar::MSWGetStyle(long style, WXDWORD *exstyle) const
return msStyle;
}
WXHBRUSH wxScrollBar::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
WXHBRUSH wxScrollBar::MSWControlColor(WXHDC pDC, WXHWND hWnd)
{
HDC hdc = (HDC)pDC;
if ( m_hasFgCol )
{
::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
}
WXHBRUSH hbr = 0;
return hbr;
// unless we have an explicitly set bg colour, use default (gradient under
// XP) brush instead of GetBackgroundColour() one as the base class would
//
// note that fg colour isn't used for a scrollbar
return UseBgCol() ? wxControl::MSWControlColor(pDC, hWnd) : NULL;
}
#endif // wxUSE_SCROLLBAR