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
This commit is contained in:
Michael R Sweet 2003-06-15 04:41:16 +00:00
parent 29019ade40
commit aa88761194
3 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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 $".
//

View File

@ -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 $".
//