Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Japanese IME test code
Re: Japanese IME test code [message #15170 is a reply to message #15163] |
Mon, 07 April 2008 03:10   |
mobilehunter
Messages: 87 Registered: November 2006
|
Member |
|
|
Hi Mirek,
Thanks for the reply.
I change the code for displaying the IME window to controls such as RichEdit and EditField, since as my understanding those controls know their font and caret position better. And add a virtual function DisplayIMEWindow() to those controls.
So the implementation inside Win32Proc.cpp:
case WM_IME_STARTCOMPOSITION:
{
Ctrl*f=GetFocusChild();
if(f)
f->DisplayIMEWindow();
}
break;
And below are the implementation inside EditField control
void EditField::DisplayIMEWindow()
{
HWND hwnd =this->GetParent()->GetHWND();
POINT pt;
FontInfo fi = font.Info();
GetCaretPos(&pt);
HIMC hIMC = ImmGetContext(hwnd);
COMPOSITIONFORM cf;
LOGFONT lf;
HFONT hfont = fi.GetHFONT();
GetObject(hfont, sizeof(LOGFONT), &lf);
ImmSetCompositionFont(hIMC, &lf);
cf.dwStyle = CFS_POINT;
cf.ptCurrentPos.x = pt.x;
cf.ptCurrentPos.y = pt.y;
ImmSetCompositionWindow(hIMC, &cf);
ImmReleaseContext(hwnd, hIMC);
}
And below inside RichEdit control (kbd.cpp):
void RichEdit::DisplayIMEWindow()
{
HWND hwnd = this->GetParent()->GetHWND();
POINT pt;
FontInfo fi = formatinfo.Info();
GetCaretPos(&pt);
HIMC hIMC = ImmGetContext(hwnd);
COMPOSITIONFORM cf;
LOGFONT lf;
HFONT hfont = fi.GetHFONT();
::GetObject(hfont, sizeof(LOGFONT), &lf);
ImmSetCompositionFont(hIMC, &lf);
cf.dwStyle = CFS_POINT;
cf.ptCurrentPos.x = pt.x;
cf.ptCurrentPos.y = pt.y;
ImmSetCompositionWindow(hIMC, &cf);
ImmReleaseContext(hwnd, hIMC);
}
I still have problem with the font size for IME window.
And have problem debugging the codes. The IDE will hang if i press F10 key after a break point.
|
|
|
 |
|
Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Sun, 06 April 2008 08:14
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Tue, 15 April 2008 21:17
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Wed, 23 April 2008 10:02
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Sat, 26 April 2008 10:26
|
 |
|
Re: Japanese IME test code
By: mirek on Sat, 26 April 2008 10:27
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Sat, 26 April 2008 15:00
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Tue, 29 April 2008 18:56
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Tue, 06 May 2008 19:49
|
 |
|
Re: Japanese IME test code
By: mirek on Tue, 06 May 2008 22:21
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Thu, 08 May 2008 09:52
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Wed, 14 May 2008 09:13
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
|
 |
|
Re: Japanese IME test code
By: mirek on Fri, 16 May 2008 09:14
|
Goto Forum:
Current Time: Tue May 13 23:44:56 CEST 2025
Total time taken to generate the page: 0.00436 seconds
|