From: Robert Roebling Date: Tue, 3 Jul 2007 11:17:40 +0000 (+0000) Subject: Let GtkScrolledWindow handle scroll wheel events. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/602e33659eb95fd1caa795d5d1ddcc259a9fd475 Let GtkScrolledWindow handle scroll wheel events. Reset visible range in wxListCtrl after scrolling. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index efbfd62082..a97c0b1343 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4798,10 +4798,6 @@ void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data ) void wxListMainWindow::OnScroll(wxScrollWinEvent& event) { - // update our idea of which lines are shown when we redraw the window the - // next time - ResetVisibleLinesRange(); - // FIXME #if ( defined(__WXGTK__) || defined(__WXMAC__) ) && !defined(__WXUNIVERSAL__) wxScrolledWindow::OnScroll(event); @@ -4809,6 +4805,10 @@ void wxListMainWindow::OnScroll(wxScrollWinEvent& event) HandleOnScroll( event ); #endif + // update our idea of which lines are shown when we redraw the window the + // next time + ResetVisibleLinesRange(); + if ( event.GetOrientation() == wxHORIZONTAL && HasHeader() ) { wxGenericListCtrl* lc = GetListCtrl(); diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 682e7043dc..9eb9d41825 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -277,10 +277,14 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event); } #if wxUSE_MOUSEWHEEL + // Use GTK's own scroll wheel handling in GtkScrolledWindow +#ifndef __WXGTK20__ else if ( evType == wxEVT_MOUSEWHEEL ) { m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event); + return true; } +#endif #endif // wxUSE_MOUSEWHEEL else if ( evType == wxEVT_CHAR ) {