aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorJason Rumney <[email protected]>2004-09-07 21:48:37 +0000
committerJason Rumney <[email protected]>2004-09-07 21:48:37 +0000
commitb400534923150b29c26480361e4fdf9573ef467a (patch)
tree571d8eaf09255c7fafe500e7a24ca80fb6e914af /src/w32fns.c
parentd0f483e8e104e69fa38de5e816c50caf6fdfbecd (diff)
(w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Unicode menu titles.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index e60385c812..5cfc4adb0a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -260,6 +260,7 @@ typedef BOOL (WINAPI * TrackMouseEvent_Proc)
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 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
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 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
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);