#define SIF_TRACKPOS 16
#endif
+#if wxUSE_MOUSEWHEEL
+ #ifndef WM_MOUSEWHEEL
+ #define WM_MOUSEWHEEL 0x020A
+ #endif
+ #ifndef WHEEL_DELTA
+ #define WHEEL_DELTA 120
+ #endif
+ #ifndef SPI_GETWHEELSCROLLLINES
+ #define SPI_GETWHEELSCROLLLINES 104
+ #endif
+#endif
+
+
// ---------------------------------------------------------------------------
// global variables
// ---------------------------------------------------------------------------
wParam);
break;
+#if wxUSE_MOUSEWHEEL
+ case WM_MOUSEWHEEL:
+ processed = HandleMouseWheel(wParam, lParam);
+ break;
+#endif
+
case WM_LBUTTONDOWN:
// set focus to this window
if (AcceptsFocus())
return HandleMouseEvent(WM_MOUSEMOVE, x, y, flags);
}
+
+bool wxWindow::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
+{
+#if wxUSE_MOUSEWHEEL
+ wxMouseEvent event(wxEVT_MOUSEWHEEL);
+ InitMouseEvent(event,
+ GET_X_LPARAM(lParam),
+ GET_Y_LPARAM(lParam),
+ LOWORD(wParam));
+ event.m_wheelRotation = (short)HIWORD(wParam);
+ event.m_wheelDelta = WHEEL_DELTA;
+
+#ifdef __WIN32__
+ static int s_linesPerRotation = -1;
+ if ( s_linesPerRotation == -1 )
+ {
+ if ( !::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
+ &s_linesPerRotation, 0))
+ {
+ // this is not supposed to happen
+ wxLogLastError(_T("SystemParametersInfo(GETWHEELSCROLLLINES)"));
+
+ // the default is 3, so use it if SystemParametersInfo() failed
+ s_linesPerRotation = 3;
+ }
+ }
+#else // Win16
+ // no SystemParametersInfo() under Win16
+ static const int s_linesPerRotation = 3;
+#endif
+
+ event.m_linesPerAction = s_linesPerRotation;
+ return GetEventHandler()->ProcessEvent(event);
+
+#else
+ return FALSE;
+#endif
+}
+
+
// ---------------------------------------------------------------------------
// keyboard handling
// ---------------------------------------------------------------------------
case 0x0207: return "WM_MBUTTONDOWN";
case 0x0208: return "WM_MBUTTONUP";
case 0x0209: return "WM_MBUTTONDBLCLK";
+ case 0x020A: return "WM_MOUSEWHEEL";
case 0x0210: return "WM_PARENTNOTIFY";
case 0x0211: return "WM_ENTERMENULOOP";
case 0x0212: return "WM_EXITMENULOOP";