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);
{
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);
}
}