comctl32: Mousewheel support for updown control.

This commit is contained in:
Peter Urbanec 2008-04-11 17:19:58 +10:00 committed by Alexandre Julliard
parent 9f82e4730b
commit 287561cce5
1 changed files with 31 additions and 0 deletions

View File

@ -469,6 +469,28 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
return 0;
}
/***********************************************************************
* 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);