X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..748fbf95a859df3b1b9f8b95ee8cd0cc4d205a85:/src/generic/scrolwin.cpp diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 3a07c7886e..e12edf05c9 100644 --- a/src/generic/scrolwin.cpp +++ b/src/generic/scrolwin.cpp @@ -174,42 +174,49 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) // ProcessEvent() above event.Skip(FALSE); - switch ( event.GetEventType() ) - { - case wxEVT_SCROLLWIN_TOP: - case wxEVT_SCROLLWIN_BOTTOM: - case wxEVT_SCROLLWIN_LINEUP: - case wxEVT_SCROLLWIN_LINEDOWN: - case wxEVT_SCROLLWIN_PAGEUP: - case wxEVT_SCROLLWIN_PAGEDOWN: - case wxEVT_SCROLLWIN_THUMBTRACK: - case wxEVT_SCROLLWIN_THUMBRELEASE: - m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event); - return !event.GetSkipped(); + wxEventType evType = event.GetEventType(); - case wxEVT_PAINT: - m_scrollHelper->HandleOnPaint((wxPaintEvent &)event); - return TRUE; - - case wxEVT_SIZE: - m_scrollHelper->HandleOnSize((wxSizeEvent &)event); - return FALSE; + if ( evType == wxEVT_PAINT ) + { + m_scrollHelper->HandleOnPaint((wxPaintEvent &)event); + return TRUE; + } - case wxEVT_CHAR: - m_scrollHelper->HandleOnChar((wxKeyEvent &)event); + if ( evType == wxEVT_SCROLLWIN_TOP || + evType == wxEVT_SCROLLWIN_BOTTOM || + evType == wxEVT_SCROLLWIN_LINEUP || + evType == wxEVT_SCROLLWIN_LINEDOWN || + evType == wxEVT_SCROLLWIN_PAGEUP || + evType == wxEVT_SCROLLWIN_PAGEDOWN || + evType == wxEVT_SCROLLWIN_THUMBTRACK || + evType == wxEVT_SCROLLWIN_THUMBRELEASE ) + { + m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event); return !event.GetSkipped(); + } - case wxEVT_ENTER_WINDOW: - m_scrollHelper->HandleOnMouseEnter((wxMouseEvent &)event); - break; - - case wxEVT_LEAVE_WINDOW: - m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event); - break; - - case wxEVT_MOUSEWHEEL: - m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event); - break; + if ( evType == wxEVT_ENTER_WINDOW ) + { + m_scrollHelper->HandleOnMouseEnter((wxMouseEvent &)event); + } + else if ( evType == wxEVT_LEAVE_WINDOW ) + { + m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event); + } +#if wxUSE_MOUSEWHEEL + else if ( evType == wxEVT_MOUSEWHEEL ) + { + m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event); + } +#endif // wxUSE_MOUSEWHEEL + else if ( evType == wxEVT_SIZE ) + { + m_scrollHelper->HandleOnSize((wxSizeEvent &)event); + } + else if ( evType == wxEVT_CHAR ) + { + m_scrollHelper->HandleOnChar((wxKeyEvent &)event); + return !event.GetSkipped(); } return FALSE; @@ -235,7 +242,9 @@ wxScrollHelper::wxScrollHelper(wxWindow *win) m_scaleX = m_scaleY = 1.0; +#if wxUSE_MOUSEWHEEL m_wheelRotation = 0; +#endif m_win = m_targetWindow = (wxWindow *)NULL; @@ -937,6 +946,8 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event) } } +#if wxUSE_MOUSEWHEEL + void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) { m_wheelRotation += event.GetWheelRotation(); @@ -953,6 +964,8 @@ void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) } } +#endif // wxUSE_MOUSEWHEEL + // ---------------------------------------------------------------------------- // wxGenericScrolledWindow implementation // ----------------------------------------------------------------------------