X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7642be106b7d31cb7eb7b55ef74ec4072dce3a2..2cc78389312dce6285d0d6b6e891d24372252ada:/src/stc/ScintillaWX.cpp?ds=sidebyside 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);