Browse Source

[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
pull/343/head^2
donho 17 years ago
parent
commit
3b54280024
  1. 8
      PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp
  2. 14
      PowerEditor/src/ScitillaComponent/ScintillaEditView.h

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

14
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

Loading…
Cancel
Save