]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrolwin.cpp
added missing return on error
[wxWidgets.git] / src / generic / scrolwin.cpp
index 3a07c7886ed964ab7e3b3105b2c1679cd858ee99..991029613dd80ccd098c7a864381d17336fb9693 100644 (file)
@@ -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
 // ----------------------------------------------------------------------------