diff options
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/PlatWin.cxx | 32 | ||||
| -rw-r--r-- | win32/ScintRes.rc | 8 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 7 | 
3 files changed, 42 insertions, 5 deletions
| diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index f3c063c1b..00e0bf576 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2192,6 +2192,7 @@ class ListBoxX : public ListBox {  	PRectangle rcPreSize;  	Point dragOffset;  	Point location;	// Caret location at which the list is opened +	int wheelDelta; // mouse wheel residue  	HWND GetHWND() const;  	void AppendListItem(const char *startword, const char *numword); @@ -2219,7 +2220,7 @@ public:  	ListBoxX() : lineHeight(10), fontCopy(0), technology(0), lb(0), unicodeMode(false),  		desiredVisibleRows(5), maxItemCharacters(0), aveCharWidth(8),  		parent(NULL), ctrlID(0), doubleClickAction(NULL), doubleClickActionData(NULL), -		widestItem(NULL), maxCharWidth(1), resizeHit(0) { +		widestItem(NULL), maxCharWidth(1), resizeHit(0), wheelDelta(0) {  	}  	virtual ~ListBoxX() {  		if (fontCopy) { @@ -2832,6 +2833,10 @@ LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA  				}  			}  			return 0; + +		case WM_MBUTTONDOWN: +			// disable the scroll wheel button click action +			return 0;  		}  		WNDPROC prevWndProc = reinterpret_cast<WNDPROC>(GetWindowLongPtr(hWnd, GWLP_USERDATA)); @@ -2943,6 +2948,31 @@ LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam  		}  		return ::DefWindowProc(hWnd, iMessage, wParam, lParam); +	case WM_MOUSEWHEEL: +		wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam); +		if (abs(wheelDelta) >= WHEEL_DELTA) { +			int nRows = GetVisibleRows(); +			int linesToScroll = 1; +			if (nRows > 1) { +				linesToScroll = nRows - 1; +			} +			if (linesToScroll > 3) { +				linesToScroll = 3; +			} +			linesToScroll *= (wheelDelta / WHEEL_DELTA); +			int top = ::SendMessage(lb, LB_GETTOPINDEX, 0, 0) + linesToScroll; +			if (top < 0) { +				top = 0; +			} +			::SendMessage(lb, LB_SETTOPINDEX, top, 0); +			// update wheel delta residue +			if (wheelDelta >= 0) +				wheelDelta = wheelDelta % WHEEL_DELTA; +			else +				wheelDelta = - (-wheelDelta % WHEEL_DELTA); +		} +		break; +  	default:  		return ::DefWindowProc(hWnd, iMessage, wParam, lParam);  	} diff --git a/win32/ScintRes.rc b/win32/ScintRes.rc index 41443340a..2b50d1730 100644 --- a/win32/ScintRes.rc +++ b/win32/ScintRes.rc @@ -5,8 +5,8 @@  #include <windows.h>  VS_VERSION_INFO VERSIONINFO -FILEVERSION	2, 2, 8, 0 -PRODUCTVERSION	2, 2, 8, 0 +FILEVERSION	2, 2, 9, 0 +PRODUCTVERSION	2, 2, 9, 0  FILEFLAGSMASK	0x3fL  FILEFLAGS 0  FILEOS VOS_NT_WINDOWS32 @@ -23,12 +23,12 @@ BEGIN  		BEGIN  			VALUE	"CompanyName",	"Neil Hodgson neilh@scintilla.org\0"  			VALUE	"FileDescription",	"Scintilla.DLL - a Source Editing Component\0" -			VALUE	"FileVersion",	"2.28\0" +			VALUE	"FileVersion",	"2.29\0"  			VALUE	"InternalName",	"Scintilla\0"  			VALUE	"LegalCopyright",	"Copyright 1998-2011 by Neil Hodgson\0"  			VALUE	"OriginalFilename",	"Scintilla.DLL\0"  			VALUE	"ProductName",	"Scintilla\0" -			VALUE	"ProductVersion",	"2.28\0" +			VALUE	"ProductVersion",	"2.29\0"  		END  	END  END diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index c16da8fdb..a3c141aff 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -737,6 +737,13 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  			break;  		case WM_MOUSEWHEEL: +			// if autocomplete list active then send mousewheel message to it +			if (ac.Active()) { +				HWND hWnd = reinterpret_cast<HWND>(ac.lb->GetID()); +				::SendMessage(hWnd, iMessage, wParam, lParam); +				break; +			} +			  			// Don't handle datazoom.  			// (A good idea for datazoom would be to "fold" or "unfold" details.  			// i.e. if datazoomed out only class structures are visible, when datazooming in the control | 
