DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2644
Version: 1.3-feature
The OS X code already had support for horizontal wheels, but the X11 and
Win32 backends were left out. This patch fixes up the support for those as
well.
Link: http://www.fltk.org/str.php?L2644
Version: 1.3-feature
diff -up fltk-1.3.x-r8732/src/Fl_win32.cxx.hwheel
fltk-1.3.x-r8732/src/Fl_win32.cxx
--- fltk-1.3.x-r8732/src/Fl_win32.cxx.hwheel 2011-05-21 23:55:59.000000000
+0200
+++ fltk-1.3.x-r8732/src/Fl_win32.cxx 2011-05-24 13:37:31.109341034 +0200
@@ -1125,12 +1286,28 @@ static LRESULT CALLBACK WndProc(HWND hWn
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;
diff -up fltk-1.3.x-r8732/src/Fl_x.cxx.hwheel fltk-1.3.x-r8732/src/Fl_x.cxx
--- fltk-1.3.x-r8732/src/Fl_x.cxx.hwheel 2011-05-23 21:40:23.000000000
+0200
+++ fltk-1.3.x-r8732/src/Fl_x.cxx 2011-05-24 13:36:49.635113914 +0200
@@ -1441,12 +1608,19 @@ int fl_handle(const XEvent& thisevent)
case ButtonPress:
Fl::e_keysym = FL_Button + xevent.xbutton.button;
set_event_xy();
+ Fl::e_dx = Fl::e_dy = 0;
if (xevent.xbutton.button == Button4) {
Fl::e_dy = -1; // Up
event = FL_MOUSEWHEEL;
} else if (xevent.xbutton.button == Button5) {
Fl::e_dy = +1; // Down
event = FL_MOUSEWHEEL;
+ } else if (xevent.xbutton.button == 6) {
+ Fl::e_dx = -1; // Left
+ event = FL_MOUSEWHEEL;
+ } else if (xevent.xbutton.button == 7) {
+ Fl::e_dx = +1; // Right
+ event = FL_MOUSEWHEEL;
} else {
Fl::e_state |= (FL_BUTTON1 << (xevent.xbutton.button-1));
event = FL_PUSH;
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev