summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Input_.H3
-rw-r--r--src/Fl_Input.cxx12
2 files changed, 14 insertions, 1 deletions
diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H
index e53e9277b..dc7a319d1 100644
--- a/FL/Fl_Input_.H
+++ b/FL/Fl_Input_.H
@@ -120,7 +120,7 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
\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 @@ protected:
/** \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();
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 39dc8c5bd..5f96cf411 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -621,6 +621,18 @@ int Fl_Input::handle(int event) {
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,