aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStefan Küng <unknown>2016-09-27 10:03:48 +1000
committerStefan Küng <unknown>2016-09-27 10:03:48 +1000
commit073480a615d644f8c61e339a500243db00989a80 (patch)
treeaf17b04b82906aa15e6263a95688c53c1a86d963 /src
parentaad4df63986f194a86cd669769d5efb5872b6c1a (diff)
downloadscintilla-mirror-073480a615d644f8c61e339a500243db00989a80.tar.gz
On Win32, mouse wheel scrolling can be restricted to only occur when the mouse
is within the window.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx8
-rw-r--r--src/Editor.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index beec634d3..ee4d3947f 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -112,6 +112,7 @@ Editor::Editor() {
hasFocus = false;
errorStatus = 0;
mouseDownCaptures = true;
+ mouseWheelCaptures = true;
lastClickTime = 0;
doubleClickCloseThreshold = Point(3, 3);
@@ -7594,6 +7595,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETMOUSEDOWNCAPTURES:
return mouseDownCaptures;
+ case SCI_SETMOUSEWHEELCAPTURES:
+ mouseWheelCaptures = wParam != 0;
+ break;
+
+ case SCI_GETMOUSEWHEELCAPTURES:
+ return mouseWheelCaptures;
+
case SCI_SETCURSOR:
cursorMode = static_cast<int>(wParam);
DisplayCursor(Window::cursorText);
diff --git a/src/Editor.h b/src/Editor.h
index 72d4719ed..ee56700dd 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -176,6 +176,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool hasFocus;
bool mouseDownCaptures;
+ bool mouseWheelCaptures;
int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret
bool horizontalScrollBarVisible;