From 7495dff2470310aa7824c6982df9622a975a8f38 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 2 Nov 2001 20:59:07 +0000 Subject: [PATCH] Range check input in Fl_Browser::make_visible() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1677 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 11 +++++++++++ FL/Fl_Browser.H | 10 +++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a3fb1f88b..0eaeca576 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +CHANGES IN FLTK 1.1.0 + + - Now use -lsupc++ for Red Hat's GCC 2.96. + - Removed the "Microsoft" mode button from the menubar + demo. + - The browser demo now makes sure that the input field + contains a number. + - The Fl_Browser::make_visible() method now range checks + the input. + + CHANGES IN FLTK 1.1.0b5 **** NOTE: DUE TO CHANGES IN THE WIDGET CLASSES, **** diff --git a/FL/Fl_Browser.H b/FL/Fl_Browser.H index e23073324..7c63054f9 100644 --- a/FL/Fl_Browser.H +++ b/FL/Fl_Browser.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser.H,v 1.8.2.7 2001/01/22 15:13:37 easysw Exp $" +// "$Id: Fl_Browser.H,v 1.8.2.7.2.1 2001/11/02 20:59:07 easysw Exp $" // // Browser header file for the Fast Light Tool Kit (FLTK). // @@ -109,7 +109,11 @@ public: void column_widths(const int* l) {column_widths_ = l;} int displayed(int n) const {return Fl_Browser_::displayed(find_line(n));} - void make_visible(int n) {Fl_Browser_::display(find_line(n));} + void make_visible(int n) { + if (n < 1) Fl_Browser_::display(find_line(1)); + else if (n > lines) Fl_Browser_::display(find_line(lines)); + else Fl_Browser_::display(find_line(n)); + } // for back compatability only: void replace(int a, const char* b) {text(a, b);} @@ -119,5 +123,5 @@ public: #endif // -// End of "$Id: Fl_Browser.H,v 1.8.2.7 2001/01/22 15:13:37 easysw Exp $". +// End of "$Id: Fl_Browser.H,v 1.8.2.7.2.1 2001/11/02 20:59:07 easysw Exp $". //