From 0bc98fd29efa40f4828813fd490c2afe6e2e7c4f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 20 Mar 2005 17:41:56 +0000 Subject: Preliminary template save support in FLUID, plus some bug fixes. fluid/Fl_Type.h: - Added read_image() declaration to Fl_Window_Type class. fluid/Fl_Window_Type.cxx: - Added Overlay_Window::read_image() and Fl_Window_Type::read_image() functions. - Fl_Window_Type::fix_overlay(): update menu indices. - toggle_overlays(): update menu indices. fluid/fluid.cxx: - save_template_cb(): Added to save to ~/.fltk/fltk.org/fluid/templates, along with PNG screenshot of first window. - "Save To" instead of "Save to". - Use fl_alert() for errors, not fl_message(). - Add "File/Save Template..." and "File/Print..." (not yet implemented) menu items. - toggle_widgetbin_cb(): update menu indices. fluid/undo.cxx: - Update menu item indices. - Don't need extra slash in undo checkpoint filename. src/Fl_PNG_Image.cxx: - Fix typo in #endif comment. src/Fl_Window.cxx: - Fl_Window::draw(): save/restore flags() when changing label. - Fl_Window::iconlabel(): save/restore flags() when changing label. src/fl_rect.cxx: - fl_not_clipped(): don't use current window for gross clipping. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4147 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_PNG_Image.cxx | 2 +- src/Fl_Window.cxx | 8 +++++++- src/fl_rect.cxx | 8 +++++--- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Fl_PNG_Image.cxx b/src/Fl_PNG_Image.cxx index d07a37dfd..3aa76e4b5 100644 --- a/src/Fl_PNG_Image.cxx +++ b/src/Fl_PNG_Image.cxx @@ -47,7 +47,7 @@ extern "C" # else # include # endif // HAVE_PNG_H -#endif // HAVE_LIBPNG ** HAVE_LIBZ +#endif // HAVE_LIBPNG && HAVE_LIBZ } diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index 414074138..f8fb10253 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -92,6 +92,7 @@ int Fl_Window::y_root() const { void Fl_Window::draw() { const char *savelabel = label(); + uchar saveflags = flags(); int savex = x(); x(0); int savey = y(); y(0); // Make sure we don't draw the window title in the window background... @@ -99,13 +100,18 @@ void Fl_Window::draw() { Fl_Group::draw(); // Restore the label... Fl_Widget::label(savelabel); + set_flag(saveflags); y(savey); x(savex); } void Fl_Window::label(const char *name) {label(name, iconlabel());} -void Fl_Window::iconlabel(const char *iname) {label(label(), iname);} +void Fl_Window::iconlabel(const char *iname) { + uchar saveflags = flags(); + label(label(), iname); + set_flag(saveflags); +} // the Fl::atclose pointer is provided for back compatability. You // can now just change the callback for the window instead. diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index 272c45332..a1c06f3b6 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -29,6 +29,7 @@ // that minimal update works. #include +#include #include #include #include @@ -534,12 +535,14 @@ void fl_push_clip(int x, int y, int w, int h) { #endif } if (rstackptr < STACK_MAX) rstack[++rstackptr] = r; + else Fl::warning("fl_push_clip: clip stack overflow!\n"); fl_restore_clip(); } // make there be no clip (used by fl_begin_offscreen() only!) void fl_push_no_clip() { if (rstackptr < STACK_MAX) rstack[++rstackptr] = 0; + else Fl::warning("fl_push_no_clip: clip stack overflow!\n"); fl_restore_clip(); } @@ -548,14 +551,13 @@ void fl_pop_clip() { if (rstackptr > 0) { Fl_Region oldr = rstack[rstackptr--]; if (oldr) XDestroyRegion(oldr); - } + } else Fl::warning("fl_pop_clip: clip stack underflow!\n"); fl_restore_clip(); } // does this rectangle intersect current clip? int fl_not_clipped(int x, int y, int w, int h) { - if (x+w <= 0 || y+h <= 0 || x > Fl_Window::current()->w() - || y > Fl_Window::current()->h()) return 0; + if (x+w <= 0 || y+h <= 0) return 0; Fl_Region r = rstack[rstackptr]; #ifdef WIN32 if (!r) return 1; -- cgit v1.2.3