diff options
| author | Bill Spitzak <spitzak@gmail.com> | 1999-12-19 05:32:34 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 1999-12-19 05:32:34 +0000 |
| commit | 825182635768d61ffd86c3c806230e64a64412b3 (patch) | |
| tree | 7967d8bd37513923c4d48bf1e136f19644e6cee7 /src/Fl_Input_.cxx | |
| parent | 96286acd1b366855dc641abe5ad150a2f933e6c6 (diff) | |
Stuff that didn't get into 1.0.7:
Fix for Borland or other platforms where GLint != int.
Fixed browser scrollbars so they work if browser is inside a scroll
(it did not update their position to match where they were drawn)
Fl_Output (and non-focused Fl_Input) now scroll in response to position()
calls from the program to show the position. In addition I cleaned up the
horizontal scrolling of Fl_Input to be less screwy, it now never scrolls
if the text actually fits in the widget.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@959 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Input_.cxx')
| -rw-r--r-- | src/Fl_Input_.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 6791b4b36..09aa14688 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.3 1999/12/19 05:32:34 bill Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -197,19 +197,18 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { curx = int(expandpos(p, value()+position(), buf, 0)+.5); if (Fl::focus()==this && !was_up_down) up_down_pos = curx; cury = lines*height; - if (Fl::focus()==this) { - int fullw = int(expandpos(p, e, buf, 0)); - if (curx > xscroll_+W-20) { - xscroll_ = curx+20-W; - if (xscroll_ > fullw-W+2) xscroll_ = fullw-W+2; - mu_p = 0; erase_cursor_only = 0; - } - if (curx < xscroll_+20 && xscroll_) { - if (fullw > W-2) xscroll_ = curx-20; - else xscroll_ = 0; - mu_p = 0; erase_cursor_only = 0; - } - if (xscroll_ < 0) xscroll_ = 0; + int newscroll = xscroll_; + if (expandpos(p, e, buf, 0) < W-1) { + newscroll = 0; + } else if (curx > newscroll+W-20) { + newscroll = curx+20-W; + } else if (curx < newscroll+20) { + newscroll = curx-20; + } + if (newscroll < 0) newscroll = 0; + if (newscroll != xscroll_) { + xscroll_ = newscroll; + mu_p = 0; erase_cursor_only = 0; } } lines++; @@ -745,5 +744,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.3 1999/12/19 05:32:34 bill Exp $". // |
