- wxScrollEvent event( command, value, dir );
- event.SetScrolling( FALSE );
- event.SetEventObject( win );
- win->GetEventHandler()->ProcessEvent( event );
-
+ if (win->m_isScrolling)
+ {
+ wxEventType command = wxEVT_SCROLL_THUMBRELEASE;
+ int value = (int)ceil(win->m_adjust->value);
+ int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL;
+
+ wxScrollEvent event( command, win->GetId(), value, orient );
+ event.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( event );
+ }
+
+ win->m_isScrolling = FALSE;
+