[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
This commit is contained in:
donho 2008-01-30 20:29:31 +00:00
parent 8d0a0b8c30
commit 3b54280024
2 changed files with 22 additions and 0 deletions

View File

@ -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)

View File

@ -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