diff options
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | FL/Fl_Spinner.H | 22 |
2 files changed, 24 insertions, 0 deletions
@@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.8 + - Fl_Spinner did not handle the arrow keys properly (STR + #1476) - Fl_File_Browser did not calculate the width of directory items correctly (STR #1470) - Fl_Pack incorrectly started widgets at an offset of 1/2 diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index b84a20b9e..662ae8cb8 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -32,6 +32,7 @@ // Include necessary headers... // +# include <FL/Enumerations.H> # include <FL/Fl_Group.H> # include <FL/Fl_Input.H> # include <FL/Fl_Repeat_Button.H> @@ -141,6 +142,27 @@ class Fl_Spinner : public Fl_Group const char *format() { return (format_); } void format(const char *f) { format_ = f; update(); } + + int handle(int event) { + switch (event) { + case FL_KEYDOWN : + case FL_SHORTCUT : + if (Fl::event_key() == FL_Up) { + up_button_.do_callback(); + return 1; + } else if (Fl::event_key() == FL_Down) { + down_button_.do_callback(); + return 1; + } else return 0; + + case FL_FOCUS : + if (input_.take_focus()) return 1; + else return 0; + } + + return Fl_Group::handle(event); + } + // Speling mistaks retained for source compatibility... double maxinum() const { return (maximum_); } double maximum() const { return (maximum_); } |
