[MNEW_FEATURE] Add mouse wheel horizontal scroll feature (vista only).

Add mouse browsing (forward/back) feature.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@128 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-02-11 01:45:13 +00:00
parent e0d391d73e
commit c0ae1fefc3
3 changed files with 34 additions and 5 deletions

View File

@ -171,8 +171,8 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
// to access all the Notepad++ menu command items // to access all the Notepad++ menu command items
#define NPPM_ACTIVATEDOCMENU (NPPMSG + 49) #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49)
//void NPPM_ACTIVATEDOCMENU(int view, int index2Activate) //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
#define NPPM_GETNPPVERSION (NPPMSG + 50) #define NPPM_GETNPPVERSION (NPPMSG + 50)
// int NPPM_GETNPPVERSION(0, 0) // int NPPM_GETNPPVERSION(0, 0)

View File

@ -2401,6 +2401,7 @@ void Notepad_plus::command(int id)
case IDM_EDIT_COPY: case IDM_EDIT_COPY:
_pEditView->execute(WM_COPY); _pEditView->execute(WM_COPY);
this->_mainEditView.canGoRight();
checkClipboard(); checkClipboard();
break; break;
@ -6644,6 +6645,21 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return TRUE; return TRUE;
} }
case WM_APPCOMMAND :
{
switch(GET_APPCOMMAND_LPARAM(lParam))
{
case APPCOMMAND_BROWSER_BACKWARD :
case APPCOMMAND_BROWSER_FORWARD :
int nbDoc = _mainDocTab.isVisible()?_mainEditView.getNbDoc():0;
nbDoc += _subDocTab.isVisible()?_subEditView.getNbDoc():0;
if (nbDoc > 1)
activateNextDoc((GET_APPCOMMAND_LPARAM(lParam) == APPCOMMAND_BROWSER_FORWARD)?dirDown:dirUp);
_linkTriggered = true;
}
return TRUE;
}
case NPPM_GETNBSESSIONFILES : case NPPM_GETNBSESSIONFILES :
{ {
const char *sessionFileName = (const char *)lParam; const char *sessionFileName = (const char *)lParam;
@ -6787,7 +6803,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
} }
case NPPM_ACTIVATEDOC : case NPPM_ACTIVATEDOC :
case NPPM_ACTIVATEDOCMENU: case NPPM_TRIGGERTABBARCONTEXTMENU:
{ {
// similar to NPPM_ACTIVEDOC // similar to NPPM_ACTIVEDOC
int whichView = ((wParam != MAIN_VIEW) && (wParam != SUB_VIEW))?getCurrentView():wParam; int whichView = ((wParam != MAIN_VIEW) && (wParam != SUB_VIEW))?getCurrentView():wParam;
@ -6796,7 +6812,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
switchEditViewTo(whichView); switchEditViewTo(whichView);
activateDoc(index); activateDoc(index);
if (Message == NPPM_ACTIVATEDOCMENU) if (Message == NPPM_TRIGGERTABBARCONTEXTMENU)
{ {
// open here tab menu // open here tab menu
NMHDR nmhdr; NMHDR nmhdr;

View File

@ -142,6 +142,19 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
} }
case WM_MOUSEHWHEEL : case WM_MOUSEHWHEEL :
{
if ((short)HIWORD(wParam) > 0)
{
//if (execute(SCI_GETXOFFSET) < 10)
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, SB_LINERIGHT, NULL);
}
else
{
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, SB_LINELEFT, NULL);
}
break;
}
case WM_MOUSEWHEEL : case WM_MOUSEWHEEL :
{ {
if (LOWORD(wParam) & MK_RBUTTON) if (LOWORD(wParam) & MK_RBUTTON)
@ -721,7 +734,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
setLispLexer(); break; setLispLexer(); break;
case L_SCHEME : case L_SCHEME :
setShemeLexer(); break; setSchemeLexer(); break;
case L_ASM : case L_ASM :
setAsmLexer(); break; setAsmLexer(); break;