From 8361fd96d04388cbbe66d0b7cafefde3aad0e370 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 21 Feb 2002 07:15:11 +0000 Subject: Wheel mouse handles page at a time mode. Maintaining partial wheel deltas calculated better. Avoid Borland warning in window class registration code. --- win32/ScintillaWin.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 239c166ba..875c0252c 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #define _WIN32_WINNT 0x0400 #include @@ -541,11 +542,16 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam wheelDelta -= static_cast(HiWord(wParam)); if (abs(wheelDelta) >= WHEEL_DELTA && linesPerScroll > 0) { int linesToScroll = linesPerScroll; + if (linesPerScroll == WHEEL_PAGESCROLL) + linesToScroll = LinesOnScreen() - 1; if (linesToScroll == 0) { linesToScroll = 1; } linesToScroll *= (wheelDelta / WHEEL_DELTA); - wheelDelta = wheelDelta % WHEEL_DELTA; + if (wheelDelta >= 0) + wheelDelta = wheelDelta % WHEEL_DELTA; + else + wheelDelta = - (-wheelDelta % WHEEL_DELTA); if (wParam & MK_CONTROL) { // Zoom! We play with the font sizes in the styles. @@ -1784,7 +1790,7 @@ STDMETHODIMP ScintillaWin::GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM) { bool ScintillaWin::Register(HINSTANCE hInstance_) { hInstance = hInstance_; - bool result = true; + bool result; #if 0 // Register the Scintilla class if (IsNT()) { @@ -1803,7 +1809,7 @@ bool ScintillaWin::Register(HINSTANCE hInstance_) { wndclass.lpszMenuName = NULL; wndclass.lpszClassName = L"Scintilla"; wndclass.hIconSm = 0; - ::RegisterClassExW(&wndclass); + result = ::RegisterClassExW(&wndclass); } else { #endif // Register Scintilla as a normal character window -- cgit v1.2.3