summaryrefslogtreecommitdiff
path: root/src/Fl_Input_Choice.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-05-26 17:00:41 +0200
committerMatthias Melcher <github@matthiasm.com>2024-05-26 17:00:41 +0200
commit2bab8c94ff0d2440520b0aeefc3edaec18c02595 (patch)
tree2a80ba1aac59bc55aaadf6b95b8dc74a377be976 /src/Fl_Input_Choice.cxx
parent00dc35097b86f77d4aae7c789b03c70690f4b97f (diff)
Revert InputChoice from fd791a0
A change to Fl_Input_Choice callbacks slipped into fd791a068e39e06785adc44693f4c533d3d6c903. This Commit removes that change. It may need to be fixed and reapplied later in its own Commit.
Diffstat (limited to 'src/Fl_Input_Choice.cxx')
-rw-r--r--src/Fl_Input_Choice.cxx24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/Fl_Input_Choice.cxx b/src/Fl_Input_Choice.cxx
index 534e68f19..f18eb3ac9 100644
--- a/src/Fl_Input_Choice.cxx
+++ b/src/Fl_Input_Choice.cxx
@@ -230,23 +230,15 @@ void Fl_Input_Choice::menu_cb(Fl_Widget*, void *data) {
void Fl_Input_Choice::inp_cb(Fl_Widget*, void *data) {
Fl_Input_Choice *o=(Fl_Input_Choice *)data;
Fl_Widget_Tracker wp(o);
- if ( ( (Fl::callback_reason()==FL_REASON_RELEASED)
- || (Fl::callback_reason()==FL_REASON_LOST_FOCUS) )
- && (o->when() & FL_WHEN_RELEASE) )
- {
- o->do_callback(FL_REASON_RELEASED);
+ if (o->inp_->changed()) {
+ o->Fl_Widget::set_changed();
+ if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
+ o->do_callback(FL_REASON_CHANGED);
} else {
- if (o->inp_->changed()) {
- o->Fl_Widget::set_changed();
- if (o->when() & FL_WHEN_CHANGED)
- o->do_callback(FL_REASON_CHANGED);
- } else {
- o->Fl_Widget::clear_changed();
- if (o->when() & FL_WHEN_NOT_CHANGED)
- o->do_callback(FL_REASON_RESELECTED);
- }
+ o->Fl_Widget::clear_changed();
+ if (o->when() & FL_WHEN_NOT_CHANGED)
+ o->do_callback(FL_REASON_RESELECTED);
}
-
if (wp.deleted()) return;
if (o->callback() != default_callback)
@@ -266,7 +258,7 @@ Fl_Input_Choice::Fl_Input_Choice (int X, int Y, int W, int H, const char *L)
inp_ = new Fl_Input(inp_x(), inp_y(), inp_w(), inp_h());
inp_->callback(inp_cb, (void*)this);
inp_->box(FL_FLAT_BOX); // cosmetic
- inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED|FL_WHEN_RELEASE);
+ inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED);
menu_ = new InputMenuButton(menu_x(), menu_y(), menu_w(), menu_h());
menu_->callback(menu_cb, (void*)this);
end();