From feda30118705b9bb6b2fc966655048c39a703563 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Tue, 18 Jan 2000 20:26:20 +0000 Subject: [PATCH] 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 --- src/msw/scrolbar.cpp | 10 ++++++++-- src/msw/window.cpp | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index f5c9a867dd..ab6f9668b5 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -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); } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ce331f7452..ec39a8be1d 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -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; -- 2.45.2