Author: matt
Date: 2009-09-19 14:16:21 -0700 (Sat, 19 Sep 2009)
New Revision: 6888
Log:
First few additions to create scroll wheel support for multiline Fl_Input.
Modified:
branches/branch-1.3/FL/Fl_Input_.H
branches/branch-1.3/src/Fl_Input.cxx
Modified: branches/branch-1.3/FL/Fl_Input_.H
===================================================================
--- branches/branch-1.3/FL/Fl_Input_.H 2009-09-19 20:57:48 UTC (rev 6887)
+++ branches/branch-1.3/FL/Fl_Input_.H 2009-09-19 21:16:21 UTC (rev 6888)
@@ -120,7 +120,7 @@
\p mark_, no text is selected */
int mark_;
- /** \internal Offset to text origin within wdget bounds */
+ /** \internal Offset to text origin within widget bounds */
int xscroll_, yscroll_;
/** \internal Minimal update pointer. Display requirs redraw from here to
the end
@@ -206,6 +206,7 @@
/** \internal Vertical offset of text to top edge of widget. */
int yscroll() const {return yscroll_;}
+ void yscroll(int y) { yscroll_ = y; damage(FL_DAMAGE_EXPOSE);}
/* Return the number of lines displayed on a single page. */
int linesPerPage();
Modified: branches/branch-1.3/src/Fl_Input.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Input.cxx 2009-09-19 20:57:48 UTC (rev
6887)
+++ branches/branch-1.3/src/Fl_Input.cxx 2009-09-19 21:16:21 UTC (rev
6888)
@@ -621,6 +621,18 @@
take_focus();
return 1;
+/* TODO: this will scroll the area, but stop if the cursor would become
invisible.
+ That clipping happens in drawtext(). Do we change the clipping or
should
+ we move the cursor (ouch)?
+ case FL_MOUSEWHEEL:
+ if (Fl::e_dy > 0) {
+ yscroll( yscroll() - Fl::e_dy*15 );
+ } else if (Fl::e_dy < 0) {
+ yscroll( yscroll() - Fl::e_dy*15 );
+ }
+ return 1;
+*/
+
}
Fl_Boxtype b = box();
return Fl_Input_::handletext(event,
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit