summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-09-28 12:04:12 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-09-28 12:04:12 +0000
commitfcd05e51c5c98602d70de488310da1cbc4f4cbf9 (patch)
treead0279fb425edbb4068e96ab2d7ff39383202812
parent5d33456506f652faec7628bf1798b7ad7db114e1 (diff)
Middle mouse click/drag moves scrollbar directly to the mouse position.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2642 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES3
-rw-r--r--src/Fl_Scrollbar.cxx7
2 files changed, 7 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 4a4912892..6ff079d4d 100644
--- a/CHANGES
+++ b/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
diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx
index e5efbe445..3212ccde6 100644
--- a/src/Fl_Scrollbar.cxx
+++ b/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).
//
@@ -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;
}
@@ -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 $".
//