diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-04-23 14:19:58 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-04-23 14:19:58 +0000 |
| commit | 8683ea2c810a3d689e436a8d13abbbba50efc4f5 (patch) | |
| tree | 07f4dd10cee8d33ca9b94b900ff15c056662526e /src/Fl_Text_Display.cxx | |
| parent | 8d6b757bfe1579c1c09d627329bbf15875d52cc5 (diff) | |
Adding keyboard shortcut to Fl_Value_Input and Fl_Text_Editor
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6111 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 5ae5f6ff2..e0f26e01c 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -85,12 +85,14 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) damage_range2_start = damage_range2_end = -1; dragPos = dragType = dragging = 0; display_insert_position_hint = 0; + shortcut_ = 0; color(FL_BACKGROUND2_COLOR, FL_SELECTION_COLOR); box(FL_DOWN_FRAME); textsize((uchar)FL_NORMAL_SIZE); textcolor(FL_FOREGROUND_COLOR); textfont(FL_HELVETICA); + set_flag(SHORTCUT_LABEL); text_area.x = 0; text_area.y = 0; @@ -3261,6 +3263,14 @@ int Fl_Text_Display::handle(int event) { if (mHScrollBar->handle(event)) return 1; break; + + 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; + } return 0; |
