From 839dfca77853da7ee76e585e9044e5bbf63a678f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 2 Jun 2002 17:52:36 +0000 Subject: Redraw fixes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2276 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Button.cxx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/Fl_Button.cxx') diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 9300765c3..9f2a80f59 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.14 2002/05/17 11:31:09 easysw Exp $" +// "$Id: Fl_Button.cxx,v 1.4.2.6.2.15 2002/06/02 17:52:36 easysw Exp $" // // Button widget for the Fast Light Tool Kit (FLTK). // @@ -36,8 +36,13 @@ int Fl_Button::value(int v) { v = v ? 1 : 0; oldval = v; clear_changed(); - if (value_ != v) {value_ = v; redraw(); return 1;} - else return 0; + if (value_ != v) { + value_ = v; + redraw(); + return 1; + } else { + return 0; + } } void Fl_Button::setonly() { // set this radio button on, turn others off @@ -58,6 +63,7 @@ void Fl_Button::draw() { draw_label(); if (Fl::focus() == this) draw_focus(); } + int Fl_Button::handle(int event) { int newval; switch (event) { @@ -109,15 +115,7 @@ int Fl_Button::handle(int event) { case FL_FOCUS : case FL_UNFOCUS : if (Fl::visible_focus()) { - 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... - int X = x() > 0 ? x() - 1 : 0; - int Y = y() > 0 ? y() - 1 : 0; - window()->damage(FL_DAMAGE_EXPOSE, X, Y, w() + 2, h() + 2); - } - else redraw(); + redraw(); return 1; } else return 0; case FL_KEYBOARD : @@ -147,5 +145,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.14 2002/05/17 11:31:09 easysw Exp $". +// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.15 2002/06/02 17:52:36 easysw Exp $". // -- cgit v1.2.3