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
This commit is contained in:
Robin Dunn
2002-12-19 18:27:21 +00:00
parent b65e4260a7
commit d195381766
2 changed files with 6 additions and 3 deletions

View File

@@ -139,6 +139,7 @@ END_EVENT_TABLE()
ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) {
capturedMouse = false;
wMain = win; wMain = win;
stc = win; stc = win;
wheelRotation = 0; wheelRotation = 0;
@@ -220,15 +221,16 @@ void ScintillaWX::SetTicking(bool on) {
void ScintillaWX::SetMouseCapture(bool on) { void ScintillaWX::SetMouseCapture(bool on) {
if (on && !stc->HasCapture()) if (on && !capturedMouse)
stc->CaptureMouse(); stc->CaptureMouse();
else if (!on && stc->HasCapture()) else if (!on && capturedMouse && stc->HasCapture())
stc->ReleaseMouse(); stc->ReleaseMouse();
capturedMouse = on;
} }
bool ScintillaWX::HaveMouseCapture() { bool ScintillaWX::HaveMouseCapture() {
return stc->HasCapture(); return capturedMouse;
} }

View File

@@ -151,6 +151,7 @@ public:
void DoScrollToColumn(int column); void DoScrollToColumn(int column);
private: private:
bool capturedMouse;
wxStyledTextCtrl* stc; wxStyledTextCtrl* stc;
#if wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP