X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a268018748c6efb9f51254fb987c119afd71bdd..c57e33394ca152e6e13f10363b76aef6e74a4705:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 862172c559..deee047a93 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -168,16 +168,15 @@ void wxAutoScrollTimer::Notify() bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) { wxEventType evType = event.GetEventType(); - - if ( evType == wxEVT_SIZE ) // Don't let wxPanel catch the size events. RR. + + if ( evType == wxEVT_SIZE ) { m_scrollHelper->HandleOnSize((wxSizeEvent &)event); - return TRUE; } - + if ( wxEvtHandler::ProcessEvent(event) ) return TRUE; - + // reset the skipped flag to FALSE as it might have been set to TRUE in // ProcessEvent() above event.Skip(FALSE); @@ -979,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); } }