win32_gui: use menu keys (<, >, ^, |) to scroll text windows

This commit is contained in:
Alex Kompel
2015-06-04 21:18:19 -07:00
parent 4083abe286
commit d4bcf5f628
2 changed files with 34 additions and 0 deletions

View File

@@ -1650,6 +1650,23 @@ NHMenuTextWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case WM_CHAR:
switch(wParam) {
case MENU_FIRST_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_TOP, 0);
return 0;
case MENU_LAST_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_BOTTOM, 0);
return 0;
case MENU_NEXT_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_PAGEDOWN, 0);
return 0;
case MENU_PREVIOUS_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_PAGEUP, 0);
return 0;
}
break;
/* edit control needs to know nothing of its focus */
case WM_SETFOCUS:
HideCaret(hWnd);

View File

@@ -305,6 +305,23 @@ NHEditHookWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case WM_CHAR:
switch(wParam) {
case MENU_FIRST_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_TOP, 0);
return 0;
case MENU_LAST_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_BOTTOM, 0);
return 0;
case MENU_NEXT_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_PAGEDOWN, 0);
return 0;
case MENU_PREVIOUS_PAGE:
SendMessage(hWnd, EM_SCROLL, SB_PAGEUP, 0);
return 0;
}
break;
/* edit control needs to know nothing of focus. We will take care of it
* for it */
case WM_SETFOCUS: