From afd64de00726175b7cc52b5b0c29ba25f31bb0c8 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 26 Oct 2011 10:29:13 +0000 Subject: Fixed regression (in FLTK 1.3.0) that could clear a radio button by using the keyboard (space or shortcut) (STR #2748). This regression was introduced in svn r7826 and released with FLTK 1.3.0 (!) to add visual feedback for Fl_Button's using the keyboard (STR #2372). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9149 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 2 ++ src/Fl_Button.cxx | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1b63a8fcf..60eab0974 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ CHANGES IN FLTK 1.3.1 + - Fixed regression (in FLTK 1.3.0) that could clear a radio + button by using the keyboard (space or shortcut) (STR #2748) - Fixed fl_pie() drawing too small on X11 (STR #2703) - Fixed Fl_Menu issue with unusual menu flags (STR #2680) - Fixed Windows DLL import of fl_xid() (STR #2670) diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 07daca9b4..33196ad8d 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -145,9 +145,11 @@ int Fl_Button::handle(int event) { set_changed(); triggered_by_keyboard: Fl_Widget_Tracker wp(this); - if (type() == FL_RADIO_BUTTON && !value_) { - setonly(); - if (when() & FL_WHEN_CHANGED) do_callback(); + if (type() == FL_RADIO_BUTTON) { + if (!value_) { + setonly(); + if (when() & FL_WHEN_CHANGED) do_callback(); + } } else if (type() == FL_TOGGLE_BUTTON) { value(!value()); if (when() & FL_WHEN_CHANGED) do_callback(); -- cgit v1.2.3