diff options
| author | Manolo Gouy <Manolo> | 2012-06-21 08:52:29 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-06-21 08:52:29 +0000 |
| commit | cbcf0c931278671f4db01ff384f4973a7be322eb (patch) | |
| tree | fa4a8e55e83baa159a9ced51a61271c58520288a /src/Fl_win32.cxx | |
| parent | 27e406f7512c0e922bc040568331efe30e0838de (diff) | |
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
Diffstat (limited to 'src/Fl_win32.cxx')
| -rw-r--r-- | src/Fl_win32.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
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; |
