// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "scrolbar.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
IMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl,"wx/scrolbar.h")
wxBEGIN_PROPERTIES_TABLE(wxScrollBar)
- wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent )
+ wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_CHANGED , wxScrollEvent )
wxPROPERTY( ThumbPosition , int , SetThumbPosition, GetThumbPosition, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
case SB_ENDSCROLL:
nScrollInc = 0;
- scrollEvent = wxEVT_SCROLL_ENDSCROLL;
+ scrollEvent = wxEVT_SCROLL_CHANGED;
break;
default:
SetThumbPosition(position);
}
else if ( scrollEvent != wxEVT_SCROLL_THUMBRELEASE &&
- scrollEvent != wxEVT_SCROLL_ENDSCROLL )
+ scrollEvent != wxEVT_SCROLL_CHANGED )
{
// don't process the event if there is no displacement,
// unless this is a thumb release or end scroll event.
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