From 85533d11be0b32799d1baf343a13a633cb041ea2 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 2 Aug 2001 21:11:43 +0000 Subject: Fix mouse wheel stuff for browser and helpview widgets (move 3 lines at a time...) Fl_Group::handle() now sends unknown events to the focus widget first, then to any other child that will take it... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1542 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_HelpView.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Fl_HelpView.cxx') diff --git a/src/Fl_HelpView.cxx b/src/Fl_HelpView.cxx index d5a599157..15579c41b 100644 --- a/src/Fl_HelpView.cxx +++ b/src/Fl_HelpView.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_HelpView.cxx,v 1.1.2.2 2001/08/02 20:18:54 easysw Exp $" +// "$Id: Fl_HelpView.cxx,v 1.1.2.3 2001/08/02 21:11:43 easysw Exp $" // // Fl_HelpView widget routines. // @@ -2197,15 +2197,21 @@ Fl_HelpView::handle(int event) // I - Event to handle switch (event) { - case FL_MOVE : case FL_PUSH : + case FL_MOVE : xx = Fl::event_x() - x(); yy = Fl::event_y() - y() + topline_; if (!scrollbar_.visible() || xx < (w() - 20)) break; case FL_MOUSEWHEEL : - topline(topline() + Fl::e_dy * textsize_ * 3); + i = topline() + Fl::e_dy * textsize_ * 3; + if (i < 0) + i = 0; + else if (i > (size_ - h())) + i = size_ - h(); + + topline(i); return (1); default : @@ -3126,5 +3132,5 @@ scrollbar_callback(Fl_Widget *s, void *) // -// End of "$Id: Fl_HelpView.cxx,v 1.1.2.2 2001/08/02 20:18:54 easysw Exp $". +// End of "$Id: Fl_HelpView.cxx,v 1.1.2.3 2001/08/02 21:11:43 easysw Exp $". // -- cgit v1.2.3