Albrecht Schlosser wrote:
> And what happens if you apply your patch? Any side effects?
If "normal tab focus" is enabled (for multiline), there's no side
effect,
and it works as expected.
Ahh, but if "normal tab focus" is /disabled/ (ie. old FLTK behavior)
then yes, tabbing focus across an FMI field will *blot out* out the
entire field, replacing it with a tab.
So in that situation, the double-tap tab makes sense, so that
the second tab skips to the end of the field, so the next tab
you type inserts a tab at the end of the field, instead of replacing
all the text.
LOL, *that's* what it's for.
So I guess the old code is needed for the legacy behavior,
but I think we can partially solve Domingo's observed behavior
for regular Fl_Input fields, and I think to do this involves adding
two additional checks to the double-tap tab condition;
(1) check to see if input_type() == FL_MULTILINE_INPUT
(2) check if the 'normal tab focus' is disabled
So in other words:
Index: Fl_Input.cxx
===================================================================
--- Fl_Input.cxx (revision 8048)
+++ Fl_Input.cxx (working copy)
@@ -526,7 +526,9 @@
break;
case FL_KEYBOARD:
- if (Fl::event_key() == FL_Tab && mark() != position()) {
+ if (Fl::event_key() == FL_Tab && mark() != position()
+ && input_type() == FL_MULTILINE_INPUT // only do this for
multiline input fields
+ /* && ! normal_tab_focus() */ ) { // check proposed
"normal tab" flag
// Set the current cursor position to the end of the selection...
if (mark() > position())
position(mark());
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev