X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc429f89a68f4e45c11dd8638d10a270b2d82505..7948c0c24401c496c04da3c28f1f1f2f282ba327:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index b36eace80e..ae4107a1fa 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -1092,26 +1092,34 @@ void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) if (lines != 0) { - lines *= event.GetLinesPerAction(); wxScrollWinEvent newEvent; newEvent.SetPosition(0); 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 --) + if (event.IsPageScroll()) + { + if (lines > 0) + newEvent.m_eventType = wxEVT_SCROLLWIN_PAGEUP; + else + newEvent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN; + m_win->GetEventHandler()->ProcessEvent(newEvent); + } + else + { + lines *= event.GetLinesPerAction(); + if (lines > 0) + newEvent.m_eventType = wxEVT_SCROLLWIN_LINEUP; + else + newEvent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; - /* Old Way */ - // int vsx, vsy; - // GetViewStart(&vsx, &vsy); - // Scroll(-1, vsy - lines); + int times = abs(lines); + for (; times > 0; times--) + m_win->GetEventHandler()->ProcessEvent(newEvent); + } } }