Author: matt
Date: 2009-11-17 11:39:01 -0800 (Tue, 17 Nov 2009)
New Revision: 6940
Log:
STR #2292: fixed issue typing a minus in Fl_Int_Input when all text is selected.
Modified:
branches/branch-1.1/CHANGES
branches/branch-1.1/src/Fl_Input.cxx
Modified: branches/branch-1.1/CHANGES
===================================================================
--- branches/branch-1.1/CHANGES 2009-11-17 14:45:36 UTC (rev 6939)
+++ branches/branch-1.1/CHANGES 2009-11-17 19:39:01 UTC (rev 6940)
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.10
+ - Fixed selection bug in Fl_Int_Input (STR #2292)
- Fixed character set conversion functions (STR #2268)
- Fixed image lib configure and fltk-config issues by backporting
the image lib and zlib configure code from FLTK 1.3 (STR #2203)
Modified: branches/branch-1.1/src/Fl_Input.cxx
===================================================================
--- branches/branch-1.1/src/Fl_Input.cxx 2009-11-17 14:45:36 UTC (rev
6939)
+++ branches/branch-1.1/src/Fl_Input.cxx 2009-11-17 19:39:01 UTC (rev
6940)
@@ -119,13 +119,16 @@
}
#endif // HAVE_LOCALECONV
+ // find the insert position
+ int ip = position()<mark() ? position() : mark();
// This is complex to allow "0xff12" hex to be typed:
- if (!position() && (ascii == '+' || ascii == '-') ||
- (ascii >= '0' && ascii <= '9') ||
- (position()==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) ||
- (position()>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X')
- && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) ||
- input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars,
ascii)) {
+ if (!ip && (ascii == '+' || ascii == '-')
+ || (ascii >= '0' && ascii <= '9')
+ || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X'))
+ || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X')
+ && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f'))
+ || input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars,
ascii))
+ {
if (readonly()) fl_beep();
else replace(position(), mark(), &ascii, 1);
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit