From 5b0aae2e871fac79f58572b7e8f68a5bbd3d0914 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 20 Feb 2005 00:23:36 +0000 Subject: FL_MOUSEWHEEL events are now sent first to the widget under the mouse pointer and then to the first widget which accepts them. This is similar to the way shortcut events are handled and is consistent with the way the mouse wheel is handled by other toolkits. src/Fl.cxx: - Fl::handle(): Send FL_MOUSEWHEEL events to grab() or current window instead of focus widget. src/Fl_Group.cxx: - Fl_Group::handle(): Send FL_MOUSEWHEEL events first to an event_inside() widget, then to the first non-inside widget that accepts them. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4045 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Group.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Fl_Group.cxx') diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index 8655d53fe..289aa12c8 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -213,6 +213,19 @@ int Fl_Group::handle(int event) { } return 0; + case FL_MOUSEWHEEL: + for (i = children(); i--;) { + o = a[i]; + if (o->takesevents() && Fl::event_inside(o) && send(o,FL_MOUSEWHEEL)) + return 1; + } + for (i = children(); i--;) { + o = a[i]; + if (o->takesevents() && !Fl::event_inside(o) && send(o,FL_MOUSEWHEEL)) + return 1; + } + return 0; + case FL_DEACTIVATE: case FL_ACTIVATE: for (i = children(); i--;) { -- cgit v1.2.3