diff options
| author | nyamatongwe <devnull@localhost> | 2002-02-21 07:15:11 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2002-02-21 07:15:11 +0000 | 
| commit | 64495de70c9833d83b26c15e28616e43c2a10f30 (patch) | |
| tree | 3e25ce40c643baea104e3da45db9fd231eb43aad | |
| parent | 86327077937f6551b6b4118f436c73396e2ac6e6 (diff) | |
| download | scintilla-mirror-64495de70c9833d83b26c15e28616e43c2a10f30.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.cxx | 12 | 
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 | 
