From 4a883a2e81164358f960f13d42fce599f38df5bc Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 20 Dec 2010 07:48:59 +0000 Subject: Added new tab_nav() control for Fl_Multiline_Input tab navigation behavior. New default behavior is what most users expect; hitting Tab navigates over the widget. Fl_Input modified to support the new flag. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8068 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Input.cxx | 4 ++-- src/Fl_Input_.cxx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index b0d656e2c..d0e897a21 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -538,7 +538,7 @@ int Fl_Input::handle_key() { // tab handled as a normal insertable character. // if (mods==0 && !shift // Tab? - //// PROPOSED && !tab_nav() // old tab behavior enabled? + && !tab_nav() // old tab behavior enabled? && multiline) { // multiline input? break; // insert tab character } @@ -614,7 +614,7 @@ int Fl_Input::handle(int event) { // if (Fl::event_key() == FL_Tab // Tab key? && !Fl::event_state(FL_SHIFT) // no shift? - //// PROPOSED && !tab_nav() // with tab navigation disabled? + && !tab_nav() // with tab navigation disabled? && input_type() == FL_MULTILINE_INPUT // with a multiline input? && (mark()==0 && position()==size())) { // while entire field selected? // Set cursor to the end of the selection... diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index a0438356c..2c4e5336c 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1059,6 +1059,7 @@ Fl_Input_::Fl_Input_(int X, int Y, int W, int H, const char* l) maximum_size_ = 32767; shortcut_ = 0; set_flag(SHORTCUT_LABEL); + tab_nav(1); } /** -- cgit v1.2.3