Fl_Multiline_Input now scrolls the full height of the widget

instead of 5 lines when the user presses PageUp or PageDown (STR
#727)

src/Fl_Input.cxx:
    - Set repeat_num to h()/textsize() instead of 5.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4049 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-02-24 20:35:07 +00:00
parent c2873e6c63
commit 97b9464f59
2 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,9 @@
CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692)
- Fl_Multiline_Input now scrolls the full height of the
widget instead of 5 lines when the user presses PageUp
or PageDown (STR #727)
- CMake build fixes (STR #724)
- Fl_Browser::swap() didn't handle redraws properly when
the swapped lines had different heights (STR #729)

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Input.cxx,v 1.10.2.15.2.19 2004/04/11 04:38:57 easysw Exp $"
// "$Id$"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
@ -108,13 +108,15 @@ int Fl_Input::handle_key() {
case FL_Right:
ascii = ctrl('F'); break;
case FL_Page_Up:
repeat_num=5; //temporary hack
//TODO: find number of lines in window and use it instead 5
fl_font(textfont(),textsize()); //ensure current font is set to ours
repeat_num=h()/fl_height(); // number of lines to scroll
if (!repeat_num) repeat_num=1;
case FL_Up:
ascii = ctrl('P'); break;
case FL_Page_Down:
repeat_num=5; //temporary hack
//TODO: find number of lines in window and use it instead 5
fl_font(textfont(),textsize());
repeat_num=h()/fl_height();
if (!repeat_num) repeat_num=1;
case FL_Down:
ascii = ctrl('N'); break;
case FL_Home:
@ -202,18 +204,20 @@ int Fl_Input::handle_key() {
return copy_cuts();
case ctrl('N'):
i = position();
if (line_end(i) >= size()) return NORMAL_INPUT_MOVE;
while (repeat_num--) {
i = line_end(i);
if (i >= size()) return NORMAL_INPUT_MOVE;
if (i >= size()) break;
i++;
}
shift_up_down_position(i);
return 1;
case ctrl('P'):
i = position();
if (!line_start(i)) return NORMAL_INPUT_MOVE;
while(repeat_num--) {
i = line_start(i);
if (!i) return NORMAL_INPUT_MOVE;
if (!i) break;
i--;
}
shift_up_down_position(line_start(i));
@ -414,5 +418,5 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l)
}
//
// End of "$Id: Fl_Input.cxx,v 1.10.2.15.2.19 2004/04/11 04:38:57 easysw Exp $".
// End of "$Id$".
//