summaryrefslogtreecommitdiff
path: root/src/Fl_Button.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-06-02 17:52:36 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-06-02 17:52:36 +0000
commit839dfca77853da7ee76e585e9044e5bbf63a678f (patch)
tree99df2d1a5b4f88df71473d97bff1162434ddfb33 /src/Fl_Button.cxx
parent9671c0429064f38e70ba1e441cd6ec071f310b3a (diff)
Redraw fixes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2276 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Button.cxx')
-rw-r--r--src/Fl_Button.cxx24
1 files changed, 11 insertions, 13 deletions
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 $".
//