From cbcf0c931278671f4db01ff384f4973a7be322eb Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 21 Jun 2012 08:52:29 +0000 Subject: Fixed STR #2644: support horizontal wheel movement under X11 and MSWindows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9624 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Fl_win32.cxx') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 18a34dd05..e1107cb6a 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1115,12 +1115,28 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_MOUSEWHEEL: { static int delta = 0; // running total of all motion delta += (SHORT)(HIWORD(wParam)); + Fl::e_dx = 0; Fl::e_dy = -delta / WHEEL_DELTA; delta += Fl::e_dy * WHEEL_DELTA; if (Fl::e_dy) Fl::handle(FL_MOUSEWHEEL, window); return 0; } +// This is only defined on Vista and upwards... +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL 0x020E +#endif + + case WM_MOUSEHWHEEL: { + static int delta = 0; // running total of all motion + delta += (SHORT)(HIWORD(wParam)); + Fl::e_dy = 0; + Fl::e_dx = delta / WHEEL_DELTA; + delta -= Fl::e_dx * WHEEL_DELTA; + if (Fl::e_dx) Fl::handle(FL_MOUSEWHEEL, window); + return 0; + } + case WM_GETMINMAXINFO: Fl_X::i(window)->set_minmax((LPMINMAXINFO)lParam); break; -- cgit v1.2.3