From d1953817665897572bbaeab9446eb3a43d41ae9f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 19 Dec 2002 18:27:21 +0000 Subject: [PATCH] Work around HasCapture() == true when mouse button is down on the window's scrollbar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 8 +++++--- contrib/src/stc/ScintillaWX.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index a45afda5a1..a3f08a60ab 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -139,6 +139,7 @@ END_EVENT_TABLE() ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { + capturedMouse = false; wMain = win; stc = win; wheelRotation = 0; @@ -220,15 +221,16 @@ void ScintillaWX::SetTicking(bool on) { void ScintillaWX::SetMouseCapture(bool on) { - if (on && !stc->HasCapture()) + if (on && !capturedMouse) stc->CaptureMouse(); - else if (!on && stc->HasCapture()) + else if (!on && capturedMouse && stc->HasCapture()) stc->ReleaseMouse(); + capturedMouse = on; } bool ScintillaWX::HaveMouseCapture() { - return stc->HasCapture(); + return capturedMouse; } diff --git a/contrib/src/stc/ScintillaWX.h b/contrib/src/stc/ScintillaWX.h index 04b2ac0333..d904fc3c18 100644 --- a/contrib/src/stc/ScintillaWX.h +++ b/contrib/src/stc/ScintillaWX.h @@ -151,6 +151,7 @@ public: void DoScrollToColumn(int column); private: + bool capturedMouse; wxStyledTextCtrl* stc; #if wxUSE_DRAG_AND_DROP