Added IsScrollng() support for scroll and scrollwin events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -131,6 +131,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
wxEventType scrollEvent = wxEVT_NULL;
|
||||
|
||||
int nScrollInc;
|
||||
bool isScrolling = TRUE;
|
||||
switch ( wParam )
|
||||
{
|
||||
case SB_TOP:
|
||||
@@ -163,8 +164,11 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
|
||||
break;
|
||||
|
||||
case SB_THUMBTRACK:
|
||||
case SB_THUMBPOSITION:
|
||||
isScrolling = FALSE;
|
||||
/* fall-through */
|
||||
|
||||
case SB_THUMBTRACK:
|
||||
nScrollInc = pos - position;
|
||||
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
|
||||
break;
|
||||
@@ -173,9 +177,10 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
nScrollInc = 0;
|
||||
}
|
||||
|
||||
if ( nScrollInc == 0 )
|
||||
if (( nScrollInc == 0 ) && isScrolling )
|
||||
{
|
||||
// no event to process, so don't process it
|
||||
// GRG: always process SB_THUMBPOSITION !
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -190,6 +195,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
wxScrollEvent event(scrollEvent, m_windowId);
|
||||
event.SetPosition(new_pos);
|
||||
event.SetEventObject( this );
|
||||
event.SetScrolling(isScrolling);
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
@@ -3393,8 +3393,11 @@ bool wxWindow::MSWOnScroll(int orientation, WXWORD wParam,
|
||||
event.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
|
||||
break;
|
||||
|
||||
case SB_THUMBTRACK:
|
||||
case SB_THUMBPOSITION:
|
||||
event.m_isScrolling = FALSE;
|
||||
/* fall-through */
|
||||
|
||||
case SB_THUMBTRACK:
|
||||
event.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user