diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-04-22 23:33:17 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-04-22 23:33:17 +0000 |
| commit | 8198e51799ba715d27e82b276b93cb39918d3361 (patch) | |
| tree | b21114724d43324e86450d6d43ca56527b14ff7c /src | |
| parent | 6a143b1f61533c03ef20a8f2b82d2c90180055bc (diff) | |
Added support for keyboard shortcuts to Fl_Input_ derived widgets (STR #1770). Code added for Fluid. Documentation updated.
This commit must be considered partial because there is no shortcut handling for Fl_Text_Display derived widgets or Fl_Value_Input which is derived form Fl_Valuator.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6109 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Input_.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 4d96a3150..ec45d554c 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -788,6 +788,13 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { } return replace(position(), mark(), t, e-t);} + case FL_SHORTCUT: + if (!(shortcut() ? Fl::test_shortcut(shortcut()) : test_shortcut())) + return 0; + if (Fl::visible_focus() && handle(FL_FOCUS)) + Fl::focus(this); + return 1; + default: return 0; } @@ -810,6 +817,8 @@ Fl_Input_::Fl_Input_(int X, int Y, int W, int H, const char* l) value_ = ""; xscroll_ = yscroll_ = 0; maximum_size_ = 32767; + shortcut_ = 0; + set_flag(SHORTCUT_LABEL); } void Fl_Input_::put_in_buffer(int len) { |
