X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..486fd225d4942c852b913636bdc81d9a0a27f7d5:/src/msw/scrolbar.cpp diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 2072573681..007c98067f 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -48,7 +48,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, return FALSE; parent->AddChild(this); SetName(name); +#if wxUSE_VALIDATORS SetValidator(validator); +#endif // wxUSE_VALIDATORS SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; @@ -161,8 +163,12 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, scrollEvent = wxEVT_SCROLL_PAGEDOWN; break; - case SB_THUMBTRACK: case SB_THUMBPOSITION: + nScrollInc = pos - position; + scrollEvent = wxEVT_SCROLL_THUMBRELEASE; + break; + + case SB_THUMBTRACK: nScrollInc = pos - position; scrollEvent = wxEVT_SCROLL_THUMBTRACK; break; @@ -171,9 +177,10 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, nScrollInc = 0; } - if ( nScrollInc == 0 ) + // don't process the event if there is no displacement, + // unless this is a thumb release event. + if (( nScrollInc == 0 ) && ( scrollEvent != wxEVT_SCROLL_THUMBRELEASE )) { - // no event to process, so don't process it return FALSE; }