summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-08-02 20:09:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-08-02 20:09:25 +0000
commit2d3fd88eeb985c2d4cdb9659767fd0d970631ce8 (patch)
treefbe45b470d4eb1079578a0877cebfddf2d4c7d03
parent9d81d971f7861da5f558ecd797cf0aa575288dc9 (diff)
More mouse wheel stuff (as compatible as possible with the 2.0 code...)
Updated the makefile to use config.status --recheck before calling config.status (why they can't provide one that does both, I don't know...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1540 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES14
-rw-r--r--FL/Fl.H5
-rw-r--r--Makefile5
-rw-r--r--src/Fl.cxx6
-rw-r--r--src/Fl_win32.cxx21
-rw-r--r--src/Fl_x.cxx19
-rw-r--r--src/makedepend9
-rw-r--r--test/makedepend4
8 files changed, 64 insertions, 19 deletions
diff --git a/CHANGES b/CHANGES
index f8697acb9..8b0a851c7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -11,15 +11,17 @@ TODO - Added new alignment bit FL_ALIGN_TEXT_OVER_IMAGE.
TODO - Added keyboard navigation to all widgets.
-PARTIAL - Added support for mouse wheels using the new
- FL_MOUSEWHEEL event type.
+CORE - Added support for mouse wheels using the new
+ FL_MOUSEWHEEL event type. Get the mouse wheel
+ movement values from Fl::e_dx (horizontal) and
+ Fl::e_dy (vertical).
- Added the Fl_FileBrowser, Fl_FileChooser, Fl_FileIcon,
- and Fl_Wizard widgets from the bazaar.
+ Fl_HelpDialog, Fl_HelpView, and Fl_Wizard widgets from
+ the bazaar.
-TODO - Added the Fl_Check_Browser, Fl_HelpDialog,
- Fl_HelpView, Fl_Tree_Browser, and Fl_Wizard widgets
- from the bazaar.
+TODO - Added the Fl_Check_Browser, and Fl_Tree_Browser
+ widgets from the bazaar.
TODO - Added 2.0 Fl_Text_Display and Fl_Text_Editor widgets
based on NEdit.
diff --git a/FL/Fl.H b/FL/Fl.H
index e839c139a..eed1a62c3 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.H,v 1.8.2.11 2001/01/22 15:13:37 easysw Exp $"
+// "$Id: Fl.H,v 1.8.2.11.2.1 2001/08/02 20:09:25 easysw Exp $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
@@ -46,6 +46,7 @@ class Fl {
public: // should be private!
static FL_EXPORT int e_x,e_y,e_x_root,e_y_root;
+ static FL_EXPORT int e_dx, e_dy;
static FL_EXPORT int e_state;
static FL_EXPORT int e_clicks;
static FL_EXPORT int e_is_click;
@@ -217,5 +218,5 @@ public:
#endif
//
-// End of "$Id: Fl.H,v 1.8.2.11 2001/01/22 15:13:37 easysw Exp $".
+// End of "$Id: Fl.H,v 1.8.2.11.2.1 2001/08/02 20:09:25 easysw Exp $".
//
diff --git a/Makefile b/Makefile
index 84df724b1..4278c4d8e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile,v 1.12.2.6.2.3 2001/08/02 18:08:36 easysw Exp $"
+# "$Id: Makefile,v 1.12.2.6.2.4 2001/08/02 20:09:25 easysw Exp $"
#
# Top-level makefile for the Fast Light Tool Kit (FLTK).
#
@@ -57,6 +57,7 @@ distclean: clean
makeinclude: configure configh.in makeinclude.in
if test -f config.status; then \
+ ./config.status --recheck; \
./config.status; \
else \
./configure; \
@@ -66,5 +67,5 @@ configure: configure.in
autoconf
#
-# End of "$Id: Makefile,v 1.12.2.6.2.3 2001/08/02 18:08:36 easysw Exp $".
+# End of "$Id: Makefile,v 1.12.2.6.2.4 2001/08/02 20:09:25 easysw Exp $".
#
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 86a2416f3..795a39566 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.cxx,v 1.24.2.41.2.2 2001/08/02 15:31:59 easysw Exp $"
+// "$Id: Fl.cxx,v 1.24.2.41.2.3 2001/08/02 20:09:25 easysw Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -45,6 +45,8 @@ int Fl::damage_,
Fl::e_y,
Fl::e_x_root,
Fl::e_y_root,
+ Fl::e_dx,
+ Fl::e_dy,
Fl::e_state,
Fl::e_clicks,
Fl::e_is_click,
@@ -788,5 +790,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.41.2.2 2001/08/02 15:31:59 easysw Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.41.2.3 2001/08/02 20:09:25 easysw Exp $".
//
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 3fe4f4ec5..e6d97dd7c 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_win32.cxx,v 1.33.2.37 2001/04/27 15:43:38 easysw Exp $"
+// "$Id: Fl_win32.cxx,v 1.33.2.37.2.1 2001/08/02 20:09:25 easysw Exp $"
//
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
//
@@ -58,6 +58,14 @@
# define WM_MOUSELEAVE 0x02a3
#endif
+#ifndef WM_MOUSEWHEEL
+# define WM_MOUSEWHEEL 0x020a
+#endif
+
+#ifndef WHEEL_DELTA
+# define WHEEL_DELTA 120 // according to MSDN.
+#endif
+
//
// WM_FLSELECT is the user-defined message that we get when one of
// the sockets has pending data, etc.
@@ -581,6 +589,15 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
if (Fl::handle(FL_KEYBOARD,window)) return 0;
break;}
+ case WM_MOUSEWHEEL: {
+ static int delta = 0; // running total of all motion
+ delta += (SHORT)(HIWORD(wParam));
+ Fl::e_dy = delta / WHEEL_DELTA;
+ delta -= Fl::e_dy * WHEEL_DELTA;
+ if (Fl::e_dy) Fl::handle(FL_MOUSEWHEEL, window);
+ return 0;
+ }
+
case WM_GETMINMAXINFO:
Fl_X::i(window)->set_minmax((LPMINMAXINFO)lParam);
break;
@@ -974,5 +991,5 @@ void Fl_Window::make_current() {
}
//
-// End of "$Id: Fl_win32.cxx,v 1.33.2.37 2001/04/27 15:43:38 easysw Exp $".
+// End of "$Id: Fl_win32.cxx,v 1.33.2.37.2.1 2001/08/02 20:09:25 easysw Exp $".
//
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 8905e0f40..63441ef4c 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_x.cxx,v 1.24.2.24 2001/04/27 14:39:27 easysw Exp $"
+// "$Id: Fl_x.cxx,v 1.24.2.24.2.1 2001/08/02 20:09:25 easysw Exp $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
@@ -448,9 +448,18 @@ int fl_handle(const XEvent& xevent)
case ButtonPress:
Fl::e_keysym = FL_Button + xevent.xbutton.button;
- set_event_xy(); checkdouble();
- Fl::e_state |= (FL_BUTTON1 << (xevent.xbutton.button-1));
- event = FL_PUSH;
+ set_event_xy();
+ if (xevent.xbutton.button == 4) {
+ Fl::e_dy = +1;
+ event = FL_MOUSEWHEEL;
+ } else if (xevent.xbutton.button == 5) {
+ Fl::e_dy = -1;
+ event = FL_MOUSEWHEEL;
+ } else {
+ Fl::e_state |= (FL_BUTTON1 << (xevent.xbutton.button-1));
+ event = FL_PUSH;
+ checkdouble();
+ }
break;
case MotionNotify:
@@ -918,5 +927,5 @@ void Fl_Window::make_current() {
#endif
//
-// End of "$Id: Fl_x.cxx,v 1.24.2.24 2001/04/27 14:39:27 easysw Exp $".
+// End of "$Id: Fl_x.cxx,v 1.24.2.24.2.1 2001/08/02 20:09:25 easysw Exp $".
//
diff --git a/src/makedepend b/src/makedepend
index 7e893cd21..1f5241bdd 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -78,6 +78,15 @@ Fl_FileIcon.o: ../FL/filename.H
Fl_Group.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Group.H
Fl_Group.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_Group.o: ../FL/fl_draw.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
+Fl_HelpDialog.o: ../FL/Fl_HelpDialog.H ../FL/Fl.H ../FL/Enumerations.H
+Fl_HelpDialog.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+Fl_HelpDialog.o: ../FL/Fl_HelpView.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
+Fl_HelpDialog.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/fl_draw.H
+Fl_HelpDialog.o: ../FL/Fl_Button.H
+Fl_HelpView.o: ../FL/Fl_HelpView.H ../FL/Fl.H ../FL/Enumerations.H
+Fl_HelpView.o: ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+Fl_HelpView.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_HelpView.o: ../config.h ../FL/Fl_Image.H ../FL/Fl_Pixmap.H
Fl_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
Fl_Image.o: ../FL/Fl_Window.H ../FL/Fl_Widget.H ../FL/Fl_Menu_Item.H
Fl_Image.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H
diff --git a/test/makedepend b/test/makedepend
index f9ec7481c..c15226a70 100644
--- a/test/makedepend
+++ b/test/makedepend
@@ -134,6 +134,10 @@ glpuzzle.o: ../FL/Fl.H ../FL/Fl_Gl_Window.H ../FL/Fl_Window.H trackball.c
glpuzzle.o: trackball.h
hello.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
hello.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H
+help.o: ../FL/Fl_HelpDialog.H ../FL/Fl.H ../FL/Enumerations.H
+help.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
+help.o: ../FL/Fl_HelpView.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
+help.o: ../FL/Fl_Slider.H ../FL/fl_draw.H ../FL/Fl_Button.H
iconize.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H
iconize.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Box.H
image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/Fl_Group.H