X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..4b7b750dd1ffd0d26b78728adb613b282a37c058:/src/generic/scrolwin.cpp diff --git a/src/generic/scrolwin.cpp b/src/generic/scrolwin.cpp index 3a07c7886e..991029613d 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; @@ -937,6 +944,8 @@ void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event) } } +#if wxUSE_MOUSEWHEEL + void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) { m_wheelRotation += event.GetWheelRotation(); @@ -953,6 +962,8 @@ void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) } } +#endif // wxUSE_MOUSEWHEEL + // ---------------------------------------------------------------------------- // wxGenericScrolledWindow implementation // ----------------------------------------------------------------------------