comctl32: Mousewheel support for updown control.
This commit is contained in:
parent
9f82e4730b
commit
287561cce5
|
@ -469,6 +469,28 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
|
||||||
return 0;
|
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
|
* UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy
|
||||||
* control.
|
* control.
|
||||||
|
@ -486,6 +508,11 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam);
|
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);
|
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));
|
UPDOWN_HandleMouseEvent (infoPtr, message, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_MOUSEWHEEL:
|
||||||
|
UPDOWN_MouseWheel(infoPtr, wParam);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
|
if((infoPtr->dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
|
||||||
return UPDOWN_KeyPressed(infoPtr, (int)wParam);
|
return UPDOWN_KeyPressed(infoPtr, (int)wParam);
|
||||||
|
|
Loading…
Reference in New Issue