From 3b54280024a3454d432980b45713fb2611214236 Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 30 Jan 2008 20:29:31 +0000 Subject: [PATCH] [NEW_FEATURE] Add detection mouse wheel on the different view feature. User can scroll edit view when mouse on it, it's not necessary to set edit view as current view to scroll it. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@120 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/ScitillaComponent/ScintillaEditView.cpp | 8 ++++++++ .../src/ScitillaComponent/ScintillaEditView.h | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 9b16ad683..31e210e0e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -141,6 +141,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa break; } + case WM_MOUSEHWHEEL : case WM_MOUSEWHEEL : //case WM_RBUTTONDOWN : { @@ -156,6 +157,13 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa return scrollResult; break; } + +/* + { + ::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam))>0?SB_LINERIGHT:SB_LINELEFT, NULL); + break; + } +*/ case WM_VSCROLL : { if (LOWORD(wParam) == SB_ENDSCROLL) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 8263108a4..5e3c51173 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -33,6 +33,10 @@ #define WM_MOUSEWHEEL 0x020A #endif //WM_MOUSEWHEEL +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020E +#endif //WM_MOUSEHWHEEL + class NppParameters; #define NB_WORD_LIST 4 @@ -594,6 +598,16 @@ protected: static LRESULT CALLBACK scintillaStatic_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { ScintillaEditView *pScint = (ScintillaEditView *)(::GetWindowLong(hwnd, GWL_USERDATA)); // + if (Message == WM_MOUSEWHEEL || Message == WM_MOUSEHWHEEL) + { + POINT pt; + POINTS pts = MAKEPOINTS(lParam); + POINTSTOPOINT(pt, pts); + HWND hwndOnMouse = WindowFromPoint(pt); + ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLong(hwndOnMouse, GWL_USERDATA)); + if (pScintillaOnMouse != pScint) + return ::SendMessage(hwndOnMouse, Message, wParam, lParam); + } if (pScint) return (pScint->scintillaNew_Proc(hwnd, Message, wParam, lParam)); else