Skip to content

Commit

Permalink
Middle mouse click/drag moves scrollbar directly to the mouse position.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2642 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Sep 28, 2002
1 parent 5d33456 commit fcd05e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES
@@ -1,5 +1,8 @@
CHANGES IN FLTK 1.1.0

- Clicking/dragging the middle mouse button in a
scrollbar now moves directly to that scroll position,
matching the behavior of other toolkits.
- Added some more range checking to the Fl_Text_Display
widget.
- The editor demo did not correctly update the style
Expand Down
7 changes: 4 additions & 3 deletions src/Fl_Scrollbar.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.11 2002/09/04 20:33:18 easysw Exp $"
// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.12 2002/09/28 12:04:12 easysw Exp $"
//
// Scroll bar widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -93,7 +93,8 @@ int Fl_Scrollbar::handle(int event) {
if (val >= 1.0) sliderx = ww-S;
else if (val <= 0.0) sliderx = 0;
else sliderx = int(val*(ww-S)+.5);
if (relx < sliderx) area = 5;
if (Fl::event_button() == FL_MIDDLE_MOUSE) area = 8;
else if (relx < sliderx) area = 5;
else if (relx >= sliderx+S) area = 6;
else area = 8;
}
Expand Down Expand Up @@ -248,5 +249,5 @@ Fl_Scrollbar::Fl_Scrollbar(int X, int Y, int W, int H, const char* L)
}

//
// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.11 2002/09/04 20:33:18 easysw Exp $".
// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.12 2002/09/28 12:04:12 easysw Exp $".
//

0 comments on commit fcd05e5

Please sign in to comment.