Author: manolo
Date: 2012-12-15 14:03:55 -0800 (Sat, 15 Dec 2012)
New Revision: 9757
Log:
Mac OS text input: Fl::compose_state is a number of bytes (not of characters).
Modified:
branches/branch-1.3/src/Fl_Text_Editor.cxx
branches/branch-1.3/src/Fl_cocoa.mm
Modified: branches/branch-1.3/src/Fl_Text_Editor.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Text_Editor.cxx 2012-12-15 15:01:47 UTC (rev
9756)
+++ branches/branch-1.3/src/Fl_Text_Editor.cxx 2012-12-15 22:03:55 UTC (rev
9757)
@@ -514,8 +514,9 @@
int del = 0;
if (Fl::compose(del)) {
if (del) {
- int dp = insert_position(), di = del;
- while (di--) dp = buffer()->prev_char_clipped(dp);
+ // del is a number of bytes
+ int dp = insert_position() - del;
+ if ( dp < 0 ) dp = 0;
buffer()->select(dp, insert_position());
}
kill_selection(this);
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2012-12-15 15:01:47 UTC (rev 9756)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2012-12-15 22:03:55 UTC (rev 9757)
@@ -1958,7 +1958,7 @@
received, newSelection.location, newSelection.length, Fl::e_length,
Fl::compose_state, [received length]);*/
Fl_Window *target = [(FLWindow*)[self window] getFl_Window];
Fl::handle(FL_KEYBOARD, target);
- Fl::compose_state = [received length];
+ Fl::compose_state = Fl::e_length;
fl_unlock_function();
}
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit