summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2011-10-26 10:29:13 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2011-10-26 10:29:13 +0000
commitafd64de00726175b7cc52b5b0c29ba25f31bb0c8 (patch)
tree190175f0644a260706cbe01c2f910a13676a1ef9
parent8c552b377df8baad6cddfcd2eb77861961362b55 (diff)
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
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Button.cxx8
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();