diff options
author | nyamatongwe <unknown> | 2001-08-31 23:44:34 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-08-31 23:44:34 +0000 |
commit | 111ae4b1a706e2daf7c6e561a5389b57d4b7ea2b (patch) | |
tree | 41219289ecca2ec498d26427f5c9d4c3439dc81a | |
parent | 1b279c0d63397caa1f16cdcd028514442dd0b132 (diff) | |
download | scintilla-mirror-111ae4b1a706e2daf7c6e561a5389b57d4b7ea2b.tar.gz |
Moved Windows-specific mouse wheel variables from Editor to ScintillaWin.
-rw-r--r-- | src/Editor.cxx | 3 | ||||
-rw-r--r-- | src/Editor.h | 3 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 26 |
3 files changed, 15 insertions, 17 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 5b72ac579..346d1e1fd 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -85,9 +85,6 @@ Editor::Editor() { searchAnchor = 0; - ucWheelScrollLines = 0; - cWheelDelta = 0; //wheel delta from roll - xOffset = 0; xCaretMargin = 50; horizontalScrollBarVisible = true; diff --git a/src/Editor.h b/src/Editor.h index d42f5ad14..1c1a13660 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -91,9 +91,6 @@ protected: // ScintillaBase subclass needs access to much of Editor Surface pixmapSelPattern; Surface pixmapIndentGuide; Surface pixmapIndentGuideHighlight; - // Intellimouse support - currently only implemented for Windows - unsigned int ucWheelScrollLines; - int cWheelDelta; ///< Wheel delta from roll KeyMap kmap; diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c9cad5cd0..de1e8fc34 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -136,6 +136,9 @@ class ScintillaWin : bool lastKeyDownConsumed; bool capturedMouse; + + unsigned int linesPerScroll; ///< Intellimouse support + int wheelDelta; ///< Wheel delta from roll bool hasOKText; @@ -239,6 +242,8 @@ ScintillaWin::ScintillaWin(HWND hwnd) { lastKeyDownConsumed = false; capturedMouse = false; + linesPerScroll = 0; + wheelDelta = 0; // Wheel delta from roll hasOKText = false; @@ -492,27 +497,26 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam } // Either SCROLL or ZOOM. We handle the wheel steppings calculation - cWheelDelta -= static_cast<short>(HiWord(wParam)); - if (abs(cWheelDelta) >= WHEEL_DELTA && ucWheelScrollLines > 0) { - int cLineScroll; - cLineScroll = ucWheelScrollLines; - if (cLineScroll == 0) { - cLineScroll++; + wheelDelta -= static_cast<short>(HiWord(wParam)); + if (abs(wheelDelta) >= WHEEL_DELTA && linesPerScroll > 0) { + int linesToScroll = linesPerScroll; + if (linesToScroll == 0) { + linesToScroll = 1; } - cLineScroll *= (cWheelDelta / WHEEL_DELTA); - cWheelDelta = cWheelDelta % WHEEL_DELTA; + linesToScroll *= (wheelDelta / WHEEL_DELTA); + wheelDelta = wheelDelta % WHEEL_DELTA; if (wParam & MK_CONTROL) { // Zoom! We play with the font sizes in the styles. // Number of steps/line is ignored, we just care if sizing up or down - if (cLineScroll < 0) { + if (linesToScroll < 0) { KeyCommand(SCI_ZOOMIN); } else { KeyCommand(SCI_ZOOMOUT); } } else { // Scroll - ScrollTo(topLine + cLineScroll); + ScrollTo(topLine + linesToScroll); } } return 0; @@ -1312,7 +1316,7 @@ void ScintillaWin::AddCharBytes(char b0, char b1) { void ScintillaWin::GetIntelliMouseParameters() { // This retrieves the number of lines per scroll as configured inthe Mouse Properties sheet in Control Panel - ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &ucWheelScrollLines, 0); + ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0); } void ScintillaWin::CopySelTextToClipboard() { |