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
This commit is contained in:
Michael R Sweet
2002-09-28 12:04:12 +00:00
parent 5d33456506
commit fcd05e51c5
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -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
+4 -3
View File
@@ -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 $".
//