X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/999836aacade840a5d9a0cbb5fad7b1d4de62c93..02a8e64ca3a617d776e6e5f881f915aadbd47c4c:/src/generic/vscroll.cpp diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp index e592f80541..ad0951f3a7 100644 --- a/src/generic/vscroll.cpp +++ b/src/generic/vscroll.cpp @@ -374,6 +374,7 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event) size_t lineFirstNew; const wxEventType evtType = event.GetEventType(); + if ( evtType == wxEVT_SCROLLWIN_TOP ) { lineFirstNew = 0; @@ -398,21 +399,19 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event) { lineFirstNew = GetLastVisibleLine(); } + else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE ) + { + lineFirstNew = event.GetPosition(); + } + else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK ) + { + lineFirstNew = event.GetPosition(); + } + else // unknown scroll event? { - if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE ) - { - lineFirstNew = event.GetPosition(); - } - else - { - wxASSERT_MSG( evtType == wxEVT_SCROLLWIN_THUMBTRACK, - _T("unknown scroll event type?") ); - - // don't do anything, otherwise dragging the thumb around would - // be too slow - return; - } + wxFAIL_MSG( _T("unknown scroll event type?") ); + return; } ScrollToLine(lineFirstNew);