Commit 9e849c00 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Implemented mouse wheel support.

parent add0c585
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -811,6 +812,36 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -811,6 +812,36 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd); if (!(winpos->flags & SWP_NOSIZE)) WINHELP_SetupText(hWnd);
break; break;
case WM_MOUSEWHEEL:
{
int wheelDelta = 0;
UINT scrollLines = 3;
int curPos = GetScrollPos(hWnd, SB_VERT);
int min, max;
GetScrollRange(hWnd, SB_VERT, &min, &max);
SystemParametersInfo(SPI_GETWHEELSCROLLLINES,0, &scrollLines, 0);
if (wParam & (MK_SHIFT | MK_CONTROL))
return DefWindowProc(hWnd, msg, wParam, lParam);
wheelDelta -= GET_WHEEL_DELTA_WPARAM(wParam);
if (abs(wheelDelta) >= WHEEL_DELTA && scrollLines) {
int dy;
curPos += wheelDelta;
if (curPos > max)
curPos = max;
else if (curPos < min)
curPos = min;
dy = GetScrollPos(hWnd, SB_VERT) - curPos;
SetScrollPos(hWnd, SB_VERT, curPos, TRUE);
ScrollWindow(hWnd, 0, dy, NULL, NULL);
UpdateWindow(hWnd);
}
}
break;
case WM_VSCROLL: case WM_VSCROLL:
{ {
BOOL update = TRUE; BOOL update = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment