Implement horizontal mouse wheel events support for wxMSW.

Handle WM_MOUSEHWHEEL messages and translate them to the corresponding
wxMouseEvents.

Closes #14105.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-03-22 00:27:02 +00:00
parent 41469c9e5e
commit b9e52a19e6
4 changed files with 16 additions and 4 deletions

View File

@@ -2898,9 +2898,13 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
#if wxUSE_MOUSEWHEEL
case WM_MOUSEWHEEL:
processed = HandleMouseWheel(wParam, lParam);
processed = HandleMouseWheel(wxMOUSE_WHEEL_VERTICAL, wParam, lParam);
break;
#endif
case WM_MOUSEHWHEEL:
processed = HandleMouseWheel(wxMOUSE_WHEEL_HORIZONTAL, wParam, lParam);
break;
#endif // wxUSE_MOUSEWHEEL
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
@@ -5551,7 +5555,9 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
}
bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
bool
wxWindowMSW::HandleMouseWheel(wxMouseWheelAxis axis,
WXWPARAM wParam, WXLPARAM lParam)
{
#if wxUSE_MOUSEWHEEL
// notice that WM_MOUSEWHEEL position is in screen coords (as it's
@@ -5564,6 +5570,7 @@ bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
InitMouseEvent(event, pt.x, pt.y, LOWORD(wParam));
event.m_wheelRotation = (short)HIWORD(wParam);
event.m_wheelDelta = WHEEL_DELTA;
event.m_wheelAxis = axis;
static int s_linesPerRotation = -1;
if ( s_linesPerRotation == -1 )