+bool wxSlider::SendScrollEvent(EventType* event)
+{
+ wxEventType scrollEvent;
+ int newPos = event->data.ctlRepeat.value;
+ if ( newPos == GetMax() )
+ {
+ scrollEvent = wxEVT_SCROLL_TOP;
+ }
+ else if ( newPos == GetMin() )
+ {
+ scrollEvent = wxEVT_SCROLL_BOTTOM;
+ }
+ else if ( newPos == ( m_oldPos + GetLineSize() ) )
+ {
+ scrollEvent = wxEVT_SCROLL_LINEUP;
+ }
+ else if ( newPos == ( m_oldPos - GetLineSize() ) )
+ {
+ scrollEvent = wxEVT_SCROLL_LINEDOWN;
+ }
+ else if ( newPos == ( m_oldPos + GetPageSize() ) )
+ {
+ scrollEvent = wxEVT_SCROLL_PAGEUP;
+ }
+ else if ( newPos == ( m_oldPos - GetPageSize() ) )
+ {
+ scrollEvent = wxEVT_SCROLL_PAGEDOWN;
+ }
+ else
+ {
+ return false;
+ }
+
+ m_oldPos = newPos;
+
+ // first track event
+ wxScrollEvent eventWxTrack(wxEVT_SCROLL_THUMBTRACK, GetId());
+ eventWxTrack.SetPosition(newPos);
+ eventWxTrack.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(eventWxTrack);
+
+ // then scroll event
+ wxScrollEvent eventWxScroll(scrollEvent, GetId());
+ eventWxScroll.SetPosition(newPos);
+ eventWxScroll.SetEventObject(this);
+ return GetEventHandler()->ProcessEvent(eventWxScroll);
+}
+