summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-06-30 04:23:13 +0000
committerBill Spitzak <spitzak@gmail.com>2000-06-30 04:23:13 +0000
commita5ae7d54a6aa1101d1695621136cb06402bd76ef (patch)
treeb69974c6e7437f6a135677a269888ce7d3730553 /src
parente2e44bfcd5a04334e71114e124ddd90dd28cecb5 (diff)
Fix suggested by Stuart Levy to fix scrolling when deleting items from
the browser. I replaced the -$(MAKEFLAGS) with $(MFLAGS) as per the gmake documenation. Apperntly this works with other make programs and MAKEFLAGS is passed invisibly by gmake, though the documenation is not too clear... VS: ---------------------------------------------------------------------- git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1245 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Browser_.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx
index 31f6ab885..4df4d7d15 100644
--- a/src/Fl_Browser_.cxx
+++ b/src/Fl_Browser_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Browser_.cxx,v 1.10.2.13 2000/06/05 21:20:48 mike Exp $"
+// "$Id: Fl_Browser_.cxx,v 1.10.2.14 2000/06/30 04:23:13 spitzak Exp $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
@@ -397,14 +397,20 @@ void Fl_Browser_::new_list() {
// Tell it that this item is going away, and that this must remove
// all pointers to it:
void Fl_Browser_::deleting(void* l) {
- if (displayed(l)) redraw_lines();
- if (l == selection_) selection_ = 0;
- if (l == top_) {
- real_position_ -= offset_;
- offset_ = 0;
- top_ = item_next(l);
- if (!top_) top_ = item_prev(l);
+ if (displayed(l)) {
+ redraw_lines();
+ if (l == top_) {
+ real_position_ -= offset_;
+ offset_ = 0;
+ top_ = item_next(l);
+ if (!top_) top_ = item_prev(l);
+ }
+ } else {
+ // we don't know where this item is, recalculate top...
+ real_position_ = 0;
+ top_ = 0;
}
+ if (l == selection_) selection_ = 0;
if (l == max_width_item) {max_width_item = 0; max_width = 0;}
}
@@ -700,5 +706,5 @@ void Fl_Browser_::item_select(void*, int) {}
int Fl_Browser_::item_selected(void* l) const {return l==selection_;}
//
-// End of "$Id: Fl_Browser_.cxx,v 1.10.2.13 2000/06/05 21:20:48 mike Exp $".
+// End of "$Id: Fl_Browser_.cxx,v 1.10.2.14 2000/06/30 04:23:13 spitzak Exp $".
//