summaryrefslogtreecommitdiff
path: root/src/Fl_Input_Choice.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-04-17 17:51:32 +0200
committerGitHub <noreply@github.com>2024-04-17 17:51:32 +0200
commitfd791a068e39e06785adc44693f4c533d3d6c903 (patch)
treeef7ff684b38f646165e80c142e454cd7ef077e2e /src/Fl_Input_Choice.cxx
parentb4cf1a9824f2c4ba9596044962d3af36e3ca3d99 (diff)
Separate FLUID user documentation, screen shot automation (#936)
* CMake integration, no autotiools * alignment panel is now correctly renamed to setting panel * source view is now correctly renamed to code view * Merge FLTK FLUID docs into FLUID user manual. * Add two simple entry tutorials * Remove FLUID chapter form FLTK docs. * GitHub action to generate HTML and PDF docs and make the available as artefacts
Diffstat (limited to 'src/Fl_Input_Choice.cxx')
-rw-r--r--src/Fl_Input_Choice.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/Fl_Input_Choice.cxx b/src/Fl_Input_Choice.cxx
index fcb9f9c55..534e68f19 100644
--- a/src/Fl_Input_Choice.cxx
+++ b/src/Fl_Input_Choice.cxx
@@ -230,14 +230,21 @@ 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 (o->inp_->changed()) {
- o->Fl_Widget::set_changed();
- if (o->when() & (FL_WHEN_CHANGED|FL_WHEN_RELEASE))
- o->do_callback(FL_REASON_CHANGED);
+ 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);
} else {
- o->Fl_Widget::clear_changed();
- if (o->when() & FL_WHEN_NOT_CHANGED)
- o->do_callback(FL_REASON_RESELECTED);
+ 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);
+ }
}
if (wp.deleted()) return;
@@ -259,7 +266,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);
+ inp_->when(FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED|FL_WHEN_RELEASE);
menu_ = new InputMenuButton(menu_x(), menu_y(), menu_w(), menu_h());
menu_->callback(menu_cb, (void*)this);
end();