X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7642be106b7d31cb7eb7b55ef74ec4072dce3a2..73486557c0f533a7da12aee1311a3898e4a6f266:/src/stc/ScintillaWX.cpp diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index e652082bb9..30a896b903 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -95,6 +95,7 @@ ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { wMain = win; wDraw = win; stc = win; + wheelRotation = 0; Initialise(); } @@ -363,6 +364,22 @@ void ScintillaWX::DoVScroll(int type, int pos) { ScrollTo(topLineNew); } + +void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction) { + int topLineNew = topLine; + int lines; + + wheelRotation += rotation; + lines = wheelRotation / delta; + wheelRotation -= lines * delta; + if (lines != 0) { + lines *= linesPerAction; + topLineNew -= lines; + ScrollTo(topLineNew); + } +} + + void ScintillaWX::DoSize(int width, int height) { PRectangle rcClient(0,0,width,height); SetScrollBarsTo(rcClient);