]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
mingw32/cygwin compilation fixes
[wxWidgets.git] / src / generic / scrlwing.cpp
index e3149ab6018d05fa6e59c58e05b3da888f3fb5b4..deee047a932736444d799fedcf30bedca414d70c 100644 (file)
@@ -978,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);    
     }
 }