diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-04-17 17:51:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-17 17:51:32 +0200 |
| commit | fd791a068e39e06785adc44693f4c533d3d6c903 (patch) | |
| tree | ef7ff684b38f646165e80c142e454cd7ef077e2e /src | |
| parent | b4cf1a9824f2c4ba9596044962d3af36e3ca3d99 (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')
| -rw-r--r-- | src/Fl_Input_Choice.cxx | 23 | ||||
| -rw-r--r-- | src/Fl_get_system_colors.cxx | 18 |
2 files changed, 25 insertions, 16 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(); diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index e0a78fd86..ecc08a5e0 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -186,10 +186,11 @@ static Fl_Pixmap tile(tile_xpm); \param[in] s Scheme name of NULL - \returns Current scheme name or NULL - \retval NULL if the scheme has not been set or is the default scheme + \retval 0 if the scheme has not been set or is the default scheme + \retval 1 if a scheme other than "none"/"base" was set - \see Fl::is_scheme() + \see Fl::scheme() to get the name of the current scheme + \see Fl::is_scheme(const char*) to test if the specified scheme is set */ int Fl::scheme(const char *s) { if (!s) { @@ -197,12 +198,12 @@ int Fl::scheme(const char *s) { } if (s) { - if (!fl_ascii_strcasecmp(s, "none") || !fl_ascii_strcasecmp(s, "base") || !*s) s = 0; + if (!fl_ascii_strcasecmp(s, "none") || !fl_ascii_strcasecmp(s, "base") || !*s) s = NULL; else if (!fl_ascii_strcasecmp(s, "gtk+")) s = fl_strdup("gtk+"); else if (!fl_ascii_strcasecmp(s, "plastic")) s = fl_strdup("plastic"); else if (!fl_ascii_strcasecmp(s, "gleam")) s = fl_strdup("gleam"); else if (!fl_ascii_strcasecmp(s, "oxy")) s = fl_strdup("oxy"); - else s = 0; + else s = NULL; } if (scheme_) free((void*)scheme_); scheme_ = s; @@ -210,12 +211,13 @@ int Fl::scheme(const char *s) { // Save the new scheme in the FLTK_SCHEME env var so that child processes // inherit it... static char e[1024]; - strcpy(e,"FLTK_SCHEME="); - if (s) strlcat(e,s,sizeof(e)); + strcpy(e, "FLTK_SCHEME="); + if (s) strlcat(e, s, sizeof(e)); Fl::system_driver()->putenv(e); // Load the scheme... - return reload_scheme(); + reload_scheme(); + return (s != NULL); } /** |
