Mercurial > emacs
changeset 56971:a35b92556545
(w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Unicode menu titles.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Tue, 07 Sep 2004 21:48:37 +0000 |
parents | b71fc0f47c9a |
children | c6a3ae6654db |
files | src/w32fns.c |
diffstat | 1 files changed, 24 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/w32fns.c Tue Sep 07 21:16:48 2004 +0000 +++ b/src/w32fns.c Tue Sep 07 21:48:37 2004 +0000 @@ -260,6 +260,7 @@ TrackMouseEvent_Proc track_mouse_event_fn = NULL; ClipboardSequence_Proc clipboard_sequence_fn = NULL; +extern AppendMenuW_Proc unicode_append_menu; /* W95 mousewheel handler */ unsigned int msh_mousewheel = 0; @@ -3457,7 +3458,13 @@ pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE); if (title) { - GetTextExtentPoint32 (hdc, title, strlen (title), &size); + if (unicode_append_menu) + GetTextExtentPoint32W (hdc, (WCHAR *) title, + wcslen ((WCHAR *) title), + &size); + else + GetTextExtentPoint32 (hdc, title, strlen (title), &size); + pMis->itemWidth = size.cx; if (pMis->itemHeight < size.cy) pMis->itemHeight = size.cy; @@ -3495,13 +3502,22 @@ menu_font = CreateFontIndirect (&menu_logfont); old_font = SelectObject (hdc, menu_font); - /* Always draw title as if not selected. */ - ExtTextOut (hdc, - pDis->rcItem.left - + GetSystemMetrics (SM_CXMENUCHECK), - pDis->rcItem.top, - ETO_OPAQUE, &pDis->rcItem, - title, strlen (title), NULL); + /* Always draw title as if not selected. */ + if (unicode_append_menu) + ExtTextOutW (hdc, + pDis->rcItem.left + + GetSystemMetrics (SM_CXMENUCHECK), + pDis->rcItem.top, + ETO_OPAQUE, &pDis->rcItem, + (WCHAR *) title, + wcslen ((WCHAR *) title), NULL); + else + ExtTextOut (hdc, + pDis->rcItem.left + + GetSystemMetrics (SM_CXMENUCHECK), + pDis->rcItem.top, + ETO_OPAQUE, &pDis->rcItem, + title, strlen (title), NULL); SelectObject (hdc, old_font); DeleteObject (menu_font);