Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mobilehunter is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to retrieve current language?
Next Topic: CJK characters can be higlighted as keywords
Goto Forum:
  


Current Time: Sun Apr 28 06:34:19 CEST 2024

Total time taken to generate the page: 0.04907 seconds