aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-02-21 07:15:11 +0000
committernyamatongwe <unknown>2002-02-21 07:15:11 +0000
commit8361fd96d04388cbbe66d0b7cafefde3aad0e370 (patch)
tree3e25ce40c643baea104e3da45db9fd231eb43aad
parentd6e7fb59c15dc5d973124590d430805e65afdf63 (diff)
downloadscintilla-mirror-8361fd96d04388cbbe66d0b7cafefde3aad0e370.tar.gz
Wheel mouse handles page at a time mode.
Maintaining partial wheel deltas calculated better. Avoid Borland warning in window class registration code.
-rw-r--r--win32/ScintillaWin.cxx12
1 files changed, 9 insertions, 3 deletions
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 <stdio.h>
#include <ctype.h>
#include <assert.h>
+#include <limits.h>
#define _WIN32_WINNT 0x0400
#include <windows.h>
@@ -541,11 +542,16 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
wheelDelta -= static_cast<short>(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