From: Vadim Zeitlin Date: Thu, 28 Jul 2005 21:38:46 +0000 (+0000) Subject: corrected event type for standalone scrollbars (patch 1240385) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/93c96bab3d24aaac4e240e83463b1f7874f9d4b8?ds=sidebyside corrected event type for standalone scrollbars (patch 1240385) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index b7480f9fc4..f97d6ec69e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -36,7 +36,7 @@ wxOS2 wxUniv: - Window creation now honours wxVSCROLL. - +- Standalone scrollbars generate events of correct type (Jochen Roemmler) 2.6.1 ----- diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index 93fdb0ba40..4ccf1481c5 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -554,12 +554,18 @@ bool wxScrollBar::PerformAction(const wxControlAction& action, // NB: we assume that scrollbar events are sequentially numbered // but this should be ok as other code relies on this as well scrollType += wxEVT_SCROLL_TOP - wxEVT_SCROLLWIN_TOP; + wxScrollEvent event(scrollType, this->GetId(), m_thumbPos, + IsVertical() ? wxVERTICAL : wxHORIZONTAL); + event.SetEventObject(this); + GetParent()->GetEventHandler()->ProcessEvent(event); + } + else // part of the window + { + wxScrollWinEvent event(scrollType, m_thumbPos, + IsVertical() ? wxVERTICAL : wxHORIZONTAL); + event.SetEventObject(this); + GetParent()->GetEventHandler()->ProcessEvent(event); } - - wxScrollWinEvent event(scrollType, m_thumbPos, - IsVertical() ? wxVERTICAL : wxHORIZONTAL); - event.SetEventObject(this); - GetParent()->GetEventHandler()->ProcessEvent(event); } return true;