]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
Applied patch [ 603104 ] wxX11 wxClientDC, wxPaintDC fix
[wxWidgets.git] / src / generic / scrlwing.cpp
index b36eace80ec1ca21002549d6ea46a30959cdaaf2..ae4107a1fa280217d3f7aad0c9bd3f188bd16e80 100644 (file)
@@ -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);
+        }
     }
 }