diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-02-20 17:59:13 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-02-20 17:59:13 +0000 |
| commit | dc0ab1d06c3db76e8c1fd311b95abee40808864b (patch) | |
| tree | c8a6d4485b7bfce9fe0aedd5ad2eea6b8098d90b /src | |
| parent | 97c408f1d26106b50f8958e29bda160572012bba (diff) | |
STR 1719: fixed inconsistencies with FL_WHEN_NOT_CHANGED
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6031 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Button.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_Input.cxx | 7 | ||||
| -rw-r--r-- | src/Fl_Input_.cxx | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/Fl_Button.cxx b/src/Fl_Button.cxx index 984ecf0a2..a3f0a8d6a 100644 --- a/src/Fl_Button.cxx +++ b/src/Fl_Button.cxx @@ -85,7 +85,10 @@ int Fl_Button::handle(int event) { if (type() == FL_RADIO_BUTTON) newval = 1; else newval = !oldval; } else + { + clear_changed(); newval = oldval; + } if (newval != value_) { value_ = newval; set_changed(); @@ -103,6 +106,7 @@ int Fl_Button::handle(int event) { else if (type() == FL_TOGGLE_BUTTON) oldval = value_; else { value(oldval); + set_changed(); if (when() & FL_WHEN_CHANGED) do_callback(); } if (when() & FL_WHEN_RELEASE) do_callback(); diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index ffd8bf230..326b1fd66 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -409,9 +409,10 @@ int Fl_Input::handle(int event) { // user double or triple clicked to select word or whole text copy(0); } - // For output widgets, do the callback so the app knows the user - // did something with the mouse... - if (readonly()) do_callback(); + + // perform the RELEASE callback + if (when() & FL_WHEN_RELEASE) + maybe_do_callback(); return 1; case FL_DND_ENTER: diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index be6448640..e4ae2e9a6 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -715,7 +715,9 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { } else //if (Fl::selection_owner() != this) minimal_update(mark_, position_); case FL_HIDE: - if (when() & FL_WHEN_RELEASE) maybe_do_callback(); + if (!readonly() && + (when() & (FL_WHEN_RELEASE | FL_WHEN_NOT_CHANGED))) + maybe_do_callback(); return 1; case FL_PUSH: |
