Peter Urbanec : comctl32: Mousewheel support for updown control.
Module: wine Branch: master Commit: 287561cce53f526fbae117ab8245a778623092b1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=287561cce53f526fbae117ab82... Author: Peter Urbanec <winehq.org(a)urbanec.net> Date: Fri Apr 11 17:19:58 2008 +1000 comctl32: Mousewheel support for updown control. --- dlls/comctl32/updown.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 74a96f6..a62e221 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -470,6 +470,28 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key) } /*********************************************************************** + * UPDOWN_MouseWheel + * + * Handle mouse wheel scrolling + */ +static LRESULT UPDOWN_MouseWheel(UPDOWN_INFO *infoPtr, WPARAM wParam) +{ + int iWheelDelta = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA; + + if (wParam & (MK_SHIFT | MK_CONTROL)) + return 0; + + if (iWheelDelta != 0) + { + UPDOWN_GetBuddyInt(infoPtr); + UPDOWN_DoAction(infoPtr, abs(iWheelDelta), iWheelDelta > 0 ? FLAG_INCR : FLAG_DECR); + } + + return 1; +} + + +/*********************************************************************** * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy * control. */ @@ -486,6 +508,11 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); } + else if (uMsg == WM_MOUSEWHEEL) { + HWND upDownHwnd = GetPropW(hwnd, BUDDY_UPDOWN_HWND); + + UPDOWN_MouseWheel(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam); + } return CallWindowProcW( superClassWndProc, hwnd, uMsg, wParam, lParam); } @@ -929,6 +956,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L UPDOWN_HandleMouseEvent (infoPtr, message, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam)); break; + case WM_MOUSEWHEEL: + UPDOWN_MouseWheel(infoPtr, wParam); + break; + case WM_KEYDOWN: if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) return UPDOWN_KeyPressed(infoPtr, (int)wParam);
participants (1)
-
Alexandre Julliard