summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2003-06-15 04:41:16 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2003-06-15 04:41:16 +0000
commitaa88761194fd54f89d66ddf8fd90865d7ebae805 (patch)
tree0ccd51ae2c0f74f1a61e7ec46c27bf23f08e8022
parent29019ade40831dab5549a21fd0b1fd35ce9d51aa (diff)
Add clear() method to Fl_Scroll so that the scrollbars don't get deleted.
(STR #75) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3032 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES3
-rw-r--r--FL/Fl_Scroll.H5
-rw-r--r--src/Fl_Scroll.cxx12
3 files changed, 16 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 8f2beb78c..a86da0aee 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
CHANGES IN FLTK 1.1.4
+ - Fl_Scroll didn't provide its own clear() method, so
+ calling clear() on a Fl_Scroll widget would also
+ destroy the scrollbars (STR #75)
- Fl::event_text() was sometimes initialized to NULL
instead of an empty string (STR #70)
- fl_draw() didn't properly handle a trailing escaped
diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H
index 1ae93ef56..1e3168713 100644
--- a/FL/Fl_Scroll.H
+++ b/FL/Fl_Scroll.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Scroll.H,v 1.5.2.3.2.3 2003/01/30 21:40:00 easysw Exp $"
+// "$Id: Fl_Scroll.H,v 1.5.2.3.2.4 2003/06/15 04:41:16 easysw Exp $"
//
// Scroll header file for the Fast Light Tool Kit (FLTK).
//
@@ -67,10 +67,11 @@ public:
int xposition() const {return xposition_;}
int yposition() const {return yposition_;}
void position(int, int);
+ void clear();
};
#endif
//
-// End of "$Id: Fl_Scroll.H,v 1.5.2.3.2.3 2003/01/30 21:40:00 easysw Exp $".
+// End of "$Id: Fl_Scroll.H,v 1.5.2.3.2.4 2003/06/15 04:41:16 easysw Exp $".
//
diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx
index 6cfdfc98e..7d09eb8ae 100644
--- a/src/Fl_Scroll.cxx
+++ b/src/Fl_Scroll.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.4 2003/01/30 21:42:37 easysw Exp $"
+// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $"
//
// Scroll widget for the Fast Light Tool Kit (FLTK).
//
@@ -27,6 +27,14 @@
#include <FL/Fl_Scroll.H>
#include <FL/fl_draw.H>
+// Clear all but the scrollbars...
+void Fl_Scroll::clear() {
+ for (int i=children() - 1; i >= 0; i --) {
+ Fl_Widget* o = child(i);
+ if (o != &hscrollbar && o != &scrollbar) delete o;
+ }
+}
+
// Insure the scrollbars are the last children:
void Fl_Scroll::fix_scrollbar_order() {
Fl_Widget** a = (Fl_Widget**)array();
@@ -258,5 +266,5 @@ int Fl_Scroll::handle(int event) {
}
//
-// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.4 2003/01/30 21:42:37 easysw Exp $".
+// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $".
//