From 18976605f5cc721bd51c74f195c223d817ef77d5 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 17 Dec 2002 20:57:55 +0000 Subject: [PATCH] Fixed possibility of releasing mouse if the window no longer had it captured git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 8 +++----- contrib/src/stc/ScintillaWX.h | 1 - src/stc/ScintillaWX.cpp | 8 +++----- src/stc/ScintillaWX.h | 1 - 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index dc8265dcd9..a45afda5a1 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -139,7 +139,6 @@ END_EVENT_TABLE() ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { - capturedMouse = false; wMain = win; stc = win; wheelRotation = 0; @@ -221,16 +220,15 @@ void ScintillaWX::SetTicking(bool on) { void ScintillaWX::SetMouseCapture(bool on) { - if (on && !capturedMouse) + if (on && !stc->HasCapture()) stc->CaptureMouse(); - else if (!on && capturedMouse) + else if (!on && stc->HasCapture()) stc->ReleaseMouse(); - capturedMouse = on; } bool ScintillaWX::HaveMouseCapture() { - return capturedMouse; + return stc->HasCapture(); } diff --git a/contrib/src/stc/ScintillaWX.h b/contrib/src/stc/ScintillaWX.h index d904fc3c18..04b2ac0333 100644 --- a/contrib/src/stc/ScintillaWX.h +++ b/contrib/src/stc/ScintillaWX.h @@ -151,7 +151,6 @@ public: void DoScrollToColumn(int column); private: - bool capturedMouse; wxStyledTextCtrl* stc; #if wxUSE_DRAG_AND_DROP diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index dc8265dcd9..a45afda5a1 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -139,7 +139,6 @@ END_EVENT_TABLE() ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { - capturedMouse = false; wMain = win; stc = win; wheelRotation = 0; @@ -221,16 +220,15 @@ void ScintillaWX::SetTicking(bool on) { void ScintillaWX::SetMouseCapture(bool on) { - if (on && !capturedMouse) + if (on && !stc->HasCapture()) stc->CaptureMouse(); - else if (!on && capturedMouse) + else if (!on && stc->HasCapture()) stc->ReleaseMouse(); - capturedMouse = on; } bool ScintillaWX::HaveMouseCapture() { - return capturedMouse; + return stc->HasCapture(); } diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index d904fc3c18..04b2ac0333 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -151,7 +151,6 @@ public: void DoScrollToColumn(int column); private: - bool capturedMouse; wxStyledTextCtrl* stc; #if wxUSE_DRAG_AND_DROP -- 2.45.2