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 #15220 is a reply to message #15170] Thu, 10 April 2008 05:27 Go to previous messageGo to previous message
mobilehunter is currently offline  mobilehunter
Messages: 87
Registered: November 2006
Member
Another update for RichEdit control, to make the font size of IME window follows RichEdit's font size.
void RichEdit::DisplayIMEWindow()
{
  HWND hwnd = this->GetParent()->GetHWND();
  POINT pt;
  COMPOSITIONFORM cf;
  LOGFONT lf;
  HIMC hIMC = ImmGetContext(hwnd);
  GetCaretPos(&pt);	
	
  int zoomHeight = GetZoom() * tabs(formatinfo.GetHeight());
  ImmGetCompositionFont(hIMC,&lf);
  lf.lfHeight = -zoomHeight;
  ImmSetCompositionFont(hIMC, &lf);

  cf.dwStyle = CFS_POINT;
  cf.ptCurrentPos.x = pt.x;
  cf.ptCurrentPos.y = pt.y;
	
  ImmSetCompositionWindow(hIMC, &cf);
  ImmReleaseContext(hwnd, hIMC);
}


And for EditField.
void EditField::DisplayIMEWindow()
{
	HWND hwnd = this->GetParent()->GetHWND();
	POINT pt;
	COMPOSITIONFORM cf;
	LOGFONT lf;
	HIMC hIMC = ImmGetContext(hwnd);
	GetCaretPos(&pt);	
	Size sz = GetSize();
	int yy = GetTy();
	
	ImmGetCompositionFont(hIMC,&lf);
	lf.lfHeight = font.Info().GetHeight()+yy;
	ImmSetCompositionFont(hIMC, &lf);

	cf.dwStyle = CFS_POINT;
	cf.ptCurrentPos.x = pt.x;
	cf.ptCurrentPos.y = pt.y-yy;
	
	ImmSetCompositionWindow(hIMC, &cf);
	ImmReleaseContext(hwnd, hIMC);
}

[Updated on: Thu, 10 April 2008 05:59]

Report message to a moderator

 
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: Sat Apr 27 17:58:55 CEST 2024

Total time taken to generate the page: 0.02641 seconds