DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2777
Version: 3.0


The fltk3 don't have code to apply widget's font to IME composition.
It seems that the code was dropped that I've add. :)

Andalso, TextEditor don't update IME caret position.

Attached patch, Please check and include.

Thanks.


Link: http://www.fltk.org/str.php?L2777
Version: 3.0
Index: win32.cxx
===================================================================
--- win32.cxx   (revision 9187)
+++ win32.cxx   (working copy)
@@ -135,6 +135,8 @@
 static flTypeImmGetContext flImmGetContext = 0;
 typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
 static flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0;
+typedef BOOL (WINAPI *flTypeImmSetCompositionFont)(HIMC, LPLOGFONTW);
+static flTypeImmSetCompositionFont flImmSetCompositionFont = 0;
 typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC);
 static flTypeImmReleaseContext flImmReleaseContext = 0;
 typedef BOOL (WINAPI* flTypeImmIsIME)(HKL);
@@ -148,6 +150,7 @@
         "Please check your input method manager library accessibility.");
     flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, 
"ImmGetContext");
     flImmSetCompositionWindow = 
(flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, 
"ImmSetCompositionWindow");
+    flImmSetCompositionFont = 
(flTypeImmSetCompositionFont)GetProcAddress(s_imm_module, 
"ImmSetCompositionFontW");
     flImmReleaseContext = 
(flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext");
     flImmIsIME = (flTypeImmIsIME)GetProcAddress(s_imm_module, "ImmIsIME");
   }
@@ -279,6 +282,14 @@
     cfs.ptCurrentPos.y = Y - tw->labelsize();
     MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1);
     flImmSetCompositionWindow(himc, &cfs);
+
+    Fl_Font_Descriptor *desc = fltk3::graphics_driver->font_descriptor();
+    if (desc != NULL) {
+      LOGFONTW lf;
+      GetObject(desc->fid, sizeof(LOGFONTW), &lf);
+      flImmSetCompositionFont(himc, &lf);
+    }
+
     flImmReleaseContext(fl_xid(tw), himc);
   }
 }
Index: TextEditor.cxx
===================================================================
--- TextEditor.cxx      (revision 9187)
+++ TextEditor.cxx      (working copy)
@@ -565,6 +565,7 @@
 
   switch (event) {
     case fltk3::FOCUS:
+      fltk3::set_spot(textfont(), textsize(), x(), y(), w(), h(), window());
       show_cursor(mCursorOn); // redraws the cursor
       if (buffer()->selected()) redraw(); // Redraw selections...
       fltk3::focus(this);
Index: TextDisplay.cxx
===================================================================
--- TextDisplay.cxx     (revision 9187)
+++ TextDisplay.cxx     (working copy)
@@ -2118,6 +2118,11 @@
   for ( int k = 0; k < nSegs; k++ ) {
     fltk3::line( segs[ k ].x1, segs[ k ].y1, segs[ k ].x2, segs[ k ].y2 );
   }
+
+  if (fltk3::focus() == this) {
+       fltk3::set_spot(textfont(), textsize(),
+               segs[0].x1, bot, w(), h(), window());
+  }
 }
 
 
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to