diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-16 12:37:03 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-16 12:37:03 +0000 |
| commit | 10df511f733bc1cdb4a701ea735eb98e22ffbc27 (patch) | |
| tree | 4669eaa94cbf6023f9a98024e73403eb14517a52 /src/Fl_Button.cxx | |
| parent | 59842c6181adce9160c79fc99bdc44646593c8e6 (diff) | |
Better UNFOCUS redraw() fix for Fl_Button.
Adjust plastic boxtype borders.
Update dependencies.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1851 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Button.cxx')
| -rw-r--r-- | src/Fl_Button.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index ae4ddcadf..8b39d4d2b 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Button.cxx,v 1.4.2.6.2.7 2001/12/14 16:48:13 easysw Exp $" +// "$Id: Fl_Button.cxx,v 1.4.2.6.2.8 2001/12/16 12:37:02 easysw Exp $" // // Button widget for the Fast Light Tool Kit (FLTK). // @@ -26,6 +26,7 @@ #include <FL/Fl.H> #include <FL/Fl_Button.H> #include <FL/Fl_Group.H> +#include <FL/Fl_Window.H> // There are a lot of subclasses, named Fl_*_Button. Some of // them are implemented by setting the type() value and testing it @@ -108,7 +109,16 @@ int Fl_Button::handle(int event) { case FL_FOCUS : case FL_UNFOCUS : if (Fl::visible_focus()) { - if (event == FL_UNFOCUS && box() == FL_NO_BOX) parent()->redraw(); + if (event == FL_UNFOCUS && box() == FL_NO_BOX) { + // Buttons with the FL_NO_BOX boxtype need a parent to + // redraw, since it is responsible for redrawing the + // background... + Fl_Widget *p; + for (p = parent(); p; p = p->parent()) + if (p->box() != FL_NO_BOX) break; + if (p) p->redraw(); + else window()->redraw(); + } else redraw(); return 1; } else return 0; @@ -139,5 +149,5 @@ Fl_Button::Fl_Button(int x,int y,int w,int h, const char *l) } // -// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.7 2001/12/14 16:48:13 easysw Exp $". +// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.8 2001/12/16 12:37:02 easysw Exp $". // |
