diff --git a/include/wx/msw/spinctrl.h b/include/wx/msw/spinctrl.h index 8d7476344b..c81ed26665 100644 --- a/include/wx/msw/spinctrl.h +++ b/include/wx/msw/spinctrl.h @@ -65,6 +65,8 @@ public: virtual int GetBase() const; virtual bool SetBase(int base); + virtual void Refresh( bool eraseBackground = true, + const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE; // implementation only from now on // ------------------------------- diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 6c37d792db..6f1e8c7864 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -404,6 +404,19 @@ wxSpinCtrl::~wxSpinCtrl() gs_spinForTextCtrl.erase(GetBuddyHwnd()); } +void wxSpinCtrl::Refresh(bool eraseBackground, const wxRect *rect) +{ + wxControl::Refresh(eraseBackground, rect); + + UINT flags = RDW_INVALIDATE; + if ( eraseBackground ) + flags |= RDW_ERASE; + + // Don't bother computing the intersection of the given rectangle with the + // buddy control, just always refresh it entirely, as it's much simpler. + ::RedrawWindow(GetBuddyHwnd(), NULL, NULL, flags); +} + // ---------------------------------------------------------------------------- // wxSpinCtrl-specific methods // ----------------------------------------------------------------------------