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   |
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
|
|
|
 |
|
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:43:52 CEST 2025
Total time taken to generate the page: 0.00708 seconds
|