]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
1. added wxTE_AUTO_URL style and support for it under Win32 (and brief
[wxWidgets.git] / src / generic / scrlwing.cpp
index 862172c5593fa50f5244af4a0533a133fb9b7820..deee047a932736444d799fedcf30bedca414d70c 100644 (file)
@@ -168,16 +168,15 @@ void wxAutoScrollTimer::Notify()
 bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
 {
     wxEventType evType = event.GetEventType();
-    
-    if ( evType == wxEVT_SIZE )  // Don't let wxPanel catch the size events. RR.
+
+    if ( evType == wxEVT_SIZE )
     {
         m_scrollHelper->HandleOnSize((wxSizeEvent &)event);
-        return TRUE;
     }
-    
+
     if ( wxEvtHandler::ProcessEvent(event) )
         return TRUE;
-        
+
     // reset the skipped flag to FALSE as it might have been set to TRUE in
     // ProcessEvent() above
     event.Skip(FALSE);
@@ -979,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);    
     }
 }