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 #15400 is a reply to message #15290] Mon, 21 April 2008 06:33 Go to previous messageGo to previous message
mobilehunter is currently offline  mobilehunter
Messages: 87
Registered: November 2006
Member
Changed the codes.
All the functions declared as virtual
RichEdit control:
#ifdef PLATFORM_WIN32
Font RichEdit::GetIMEFont()
{
  Font imeFont(formatinfo);
  int zoomHeight = GetZoom() * tabs(formatinfo.GetHeight());
	
  imeFont.Height(zoomHeight);
  return imeFont;
}

void RichEdit::DisplayIMEWindow()
{	
  HWND hwnd = this->GetParent()->GetHWND();
  POINT pt;
  COMPOSITIONFORM cf;
  LOGFONT lf;
  GetCaretPos(&pt);	
  Font imeFont = GetIMEFont();
	
  cf.dwStyle = CFS_POINT;
  cf.ptCurrentPos.x = pt.x;
  cf.ptCurrentPos.y = pt.y;

  HIMC hIMC = ImmGetContext(hwnd);	
  ImmGetCompositionFont(hIMC,&lf);
  lf.lfHeight = -imeFont.GetHeight();
  ImmSetCompositionFont(hIMC, &lf);
  ImmSetCompositionWindow(hIMC, &cf);
  ImmReleaseContext(hwnd, hIMC);
}
#endif PLATFORM_WIN32


And for editfield control:
#ifdef PLATFORM_WIN32
Font EditField::GetIMEFont()
{
  Font imeFont(font);
  imeFont.Height(font.Info().GetHeight());
  return imeFont;
}

void EditField::DisplayIMEWindow()
{
  HWND hwnd = this->GetParent()->GetHWND();
  POINT pt;
  COMPOSITIONFORM cf;
  LOGFONT lf;
  GetCaretPos(&pt);	
  int yy = GetTy();
  Font imeFont = GetIMEFont();

  cf.dwStyle = CFS_POINT;
  cf.ptCurrentPos.x = pt.x;
  cf.ptCurrentPos.y = pt.y-yy;//to make the ime window to appear inside editfield

  HIMC hIMC = ImmGetContext(hwnd);		
  ImmGetCompositionFont(hIMC,&lf);
  lf.lfHeight = -(imeFont.GetHeight());
  ImmSetCompositionFont(hIMC, &lf);
  ImmSetCompositionWindow(hIMC, &cf);
  ImmReleaseContext(hwnd, hIMC);
}
#endif

[Updated on: Mon, 21 April 2008 06:34]

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: Sun Apr 28 00:48:15 CEST 2024

Total time taken to generate the page: 0.05660 seconds