Click scrollbar will cause recapture mouse twice error, add check sentence before capture and release mouse in HandleMouse()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:38:57 +00:00
parent d45fdc114a
commit 3725133d05

View File

@@ -1002,7 +1002,9 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer,
{
m_btnCapture = btn;
m_winCapture = consumer->GetInputWindow();
m_winCapture->CaptureMouse();
if ( !m_winCapture->HasCapture() )
m_winCapture->CaptureMouse();
// generate the command
bool hasAction = true;
@@ -1065,7 +1067,8 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer,
{
if ( m_winCapture )
{
StopScrolling(scrollbar);
if ( m_winCapture->HasCapture() )
StopScrolling(scrollbar);
// if we were dragging the thumb, send the last event
if ( m_htLast == wxHT_SCROLLBAR_THUMB )