X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2feed0044e8c8c99667da7bf8ecca52c4c707c05..82dfea7723b354423e96221d4854878874cfce58:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index e3149ab601..deee047a93 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -978,9 +978,24 @@ void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) { lines *= event.GetLinesPerAction(); - int vsx, vsy; - GetViewStart(&vsx, &vsy); - Scroll(-1, vsy - lines); + wxScrollWinEvent newEvent; + + newEvent.SetPosition(m_xScrollPosition - lines); + newEvent.SetOrientation(wxVERTICAL); + newEvent.m_eventObject = m_win; + if (lines > 0) + newEvent.m_eventType = wxEVT_SCROLLWIN_LINEUP; + else + newEvent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; + + int times = abs(lines); + for (; times > 0; times --) + m_win->GetEventHandler()->ProcessEvent(newEvent); + + /* Old Way */ + // int vsx, vsy; + // GetViewStart(&vsx, &vsy); + // Scroll(-1, vsy - lines); } }