From 32b9640e1ca9ce14f802309ad7818c23910dc62c Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 4 Sep 2002 20:33:18 +0000 Subject: Fixes from Matthew Morrise. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2618 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 4 ++++ FL/Fl_Chart.H | 5 +++-- fluid/Fl_Widget_Type.cxx | 8 +++++--- src/Fl_Chart.cxx | 8 ++++++-- src/Fl_Scrollbar.cxx | 6 ++++-- src/Fl_Tabs.cxx | 10 ++++++---- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 2abd910f3..179e44bc1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ CHANGES IN FLTK 1.1.0 + - Small bug fixes for Fl_Chart, Fl_Scrollbar, Fl_Tabs, + and FLUID from Matthew Morrise. + - Fl_Chart didn't have its own destructor, so data in + the chart wasn't freed. - Fl_Menu_Button no longer responds to focus or keyboard events when box() is FL_NO_BOX. - FLTK convenience dialogs put the buttons in the wrong diff --git a/FL/Fl_Chart.H b/FL/Fl_Chart.H index 11af43fbb..ea5106e21 100644 --- a/FL/Fl_Chart.H +++ b/FL/Fl_Chart.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Chart.H,v 1.6.2.3.2.3 2002/08/14 16:49:37 easysw Exp $" +// "$Id: Fl_Chart.H,v 1.6.2.3.2.4 2002/09/04 20:33:17 easysw Exp $" // // Forms chart header file for the Fast Light Tool Kit (FLTK). // @@ -63,6 +63,7 @@ protected: void draw(); public: Fl_Chart(int,int,int,int,const char * = 0); + ~Fl_Chart(); void clear(); void add(double, const char * =0, unsigned=0); void insert(int, double, const char * =0, unsigned=0); @@ -85,5 +86,5 @@ public: #endif // -// End of "$Id: Fl_Chart.H,v 1.6.2.3.2.3 2002/08/14 16:49:37 easysw Exp $". +// End of "$Id: Fl_Chart.H,v 1.6.2.3.2.4 2002/09/04 20:33:17 easysw Exp $". // diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index ccbb4696e..3500f1f1a 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.17 2002/08/09 22:57:00 easysw Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.18 2002/09/04 20:33:17 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -1493,7 +1493,9 @@ void Fl_Widget_Type::write_code1() { if (is_window()) { // Handle special case of Fl_Group class type within a window - // output constructor using x, y, w, h... - if (strcmp(t, "Fl_Group") == 0) + if (strcmp(t, "Fl_Group") == 0 || + strcmp(t, "Fl_Tabs") == 0 || + strcmp(t, "Fl_Tile") == 0) write_c("new %s(0, 0, %d, %d", t, o->w(), o->h()); else write_c("new %s(%d, %d", t, o->w(), o->h()); @@ -1970,5 +1972,5 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { } // -// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.17 2002/08/09 22:57:00 easysw Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.18 2002/09/04 20:33:17 easysw Exp $". // diff --git a/src/Fl_Chart.cxx b/src/Fl_Chart.cxx index ef1a34643..cd2564fc1 100644 --- a/src/Fl_Chart.cxx +++ b/src/Fl_Chart.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.9 2002/08/09 01:09:48 easysw Exp $" +// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.10 2002/09/04 20:33:18 easysw Exp $" // // Forms-compatible chart widget for the Fast Light Tool Kit (FLTK). // @@ -298,6 +298,10 @@ Fl_Widget(X,Y,W,H,l) { entries = (FL_CHART_ENTRY *)calloc(sizeof(FL_CHART_ENTRY), FL_CHART_MAX + 1); } +Fl_Chart::~Fl_Chart() { + free(entries); +} + void Fl_Chart::clear() { numb = 0; redraw(); @@ -380,5 +384,5 @@ void Fl_Chart::maxsize(int m) { } // -// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.9 2002/08/09 01:09:48 easysw Exp $". +// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.10 2002/09/04 20:33:18 easysw Exp $". // diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx index 1ef2a9a45..e5efbe445 100644 --- a/src/Fl_Scrollbar.cxx +++ b/src/Fl_Scrollbar.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.10 2002/08/13 15:42:44 easysw Exp $" +// "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.11 2002/09/04 20:33:18 easysw Exp $" // // Scroll bar widget for the Fast Light Tool Kit (FLTK). // @@ -43,9 +43,11 @@ void Fl_Scrollbar::increment_cb() { break; case 5: i = -int((maximum()-minimum())*slider_size()/(1.0-slider_size())) + ls; + if (i > -ls) i = -ls; break; case 6: i = int((maximum()-minimum())*slider_size()/(1.0-slider_size())) - ls; + if (i < ls) i = ls; break; } handle_drag(clamp(value() + i)); @@ -246,5 +248,5 @@ Fl_Scrollbar::Fl_Scrollbar(int X, int Y, int W, int H, const char* L) } // -// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.10 2002/08/13 15:42:44 easysw Exp $". +// End of "$Id: Fl_Scrollbar.cxx,v 1.7.2.14.2.11 2002/09/04 20:33:18 easysw Exp $". // diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index dd728b937..3d702b3d0 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.11 2002/08/09 03:17:30 easysw Exp $" +// "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.12 2002/09/04 20:33:18 easysw Exp $" // // Tab widget for the Fast Light Tool Kit (FLTK). // @@ -78,8 +78,10 @@ int Fl_Tabs::tab_positions(int* p, int* wp) { if (wp[i] > W) wp[i] = W; } // adjust edges according to visiblity: - for (i = children(); i > selected; i--) { - p[i] = p[i-1]+wp[i-1]; + if (selected >= 0) { + for (i = children(); i > selected; i--) { + p[i] = p[i-1]+wp[i-1]; + } } return selected; } @@ -300,5 +302,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) : } // -// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.11 2002/08/09 03:17:30 easysw Exp $". +// End of "$Id: Fl_Tabs.cxx,v 1.6.2.10.2.12 2002/09/04 20:33:18 easysw Exp $". // -- cgit v1.2.3