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;
|
wxEventType scrollEvent = wxEVT_NULL;
|
||||||
|
|
||||||
int nScrollInc;
|
int nScrollInc;
|
||||||
|
bool isScrolling = TRUE;
|
||||||
switch ( wParam )
|
switch ( wParam )
|
||||||
{
|
{
|
||||||
case SB_TOP:
|
case SB_TOP:
|
||||||
@@ -163,8 +164,11 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
|||||||
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
|
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_THUMBTRACK:
|
|
||||||
case SB_THUMBPOSITION:
|
case SB_THUMBPOSITION:
|
||||||
|
isScrolling = FALSE;
|
||||||
|
/* fall-through */
|
||||||
|
|
||||||
|
case SB_THUMBTRACK:
|
||||||
nScrollInc = pos - position;
|
nScrollInc = pos - position;
|
||||||
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
|
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
|
||||||
break;
|
break;
|
||||||
@@ -173,9 +177,10 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
|||||||
nScrollInc = 0;
|
nScrollInc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( nScrollInc == 0 )
|
if (( nScrollInc == 0 ) && isScrolling )
|
||||||
{
|
{
|
||||||
// no event to process, so don't process it
|
// no event to process, so don't process it
|
||||||
|
// GRG: always process SB_THUMBPOSITION !
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +195,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
|||||||
wxScrollEvent event(scrollEvent, m_windowId);
|
wxScrollEvent event(scrollEvent, m_windowId);
|
||||||
event.SetPosition(new_pos);
|
event.SetPosition(new_pos);
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
|
event.SetScrolling(isScrolling);
|
||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
@@ -3393,8 +3393,11 @@ bool wxWindow::MSWOnScroll(int orientation, WXWORD wParam,
|
|||||||
event.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
|
event.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_THUMBTRACK:
|
|
||||||
case SB_THUMBPOSITION:
|
case SB_THUMBPOSITION:
|
||||||
|
event.m_isScrolling = FALSE;
|
||||||
|
/* fall-through */
|
||||||
|
|
||||||
|
case SB_THUMBTRACK:
|
||||||
event.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
|
event.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user