comparison src/w32fns.c @ 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 d407cd57475c
children 201c0ad15e73 cce1c0ee76ee
comparison
equal deleted inserted replaced
56970:b71fc0f47c9a 56971:a35b92556545
258 typedef BOOL (WINAPI * TrackMouseEvent_Proc) 258 typedef BOOL (WINAPI * TrackMouseEvent_Proc)
259 (IN OUT LPTRACKMOUSEEVENT lpEventTrack); 259 (IN OUT LPTRACKMOUSEEVENT lpEventTrack);
260 260
261 TrackMouseEvent_Proc track_mouse_event_fn = NULL; 261 TrackMouseEvent_Proc track_mouse_event_fn = NULL;
262 ClipboardSequence_Proc clipboard_sequence_fn = NULL; 262 ClipboardSequence_Proc clipboard_sequence_fn = NULL;
263 extern AppendMenuW_Proc unicode_append_menu;
263 264
264 /* W95 mousewheel handler */ 265 /* W95 mousewheel handler */
265 unsigned int msh_mousewheel = 0; 266 unsigned int msh_mousewheel = 0;
266 267
267 /* Timers */ 268 /* Timers */
3455 old_font = SelectObject (hdc, menu_font); 3456 old_font = SelectObject (hdc, menu_font);
3456 3457
3457 pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE); 3458 pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE);
3458 if (title) 3459 if (title)
3459 { 3460 {
3460 GetTextExtentPoint32 (hdc, title, strlen (title), &size); 3461 if (unicode_append_menu)
3462 GetTextExtentPoint32W (hdc, (WCHAR *) title,
3463 wcslen ((WCHAR *) title),
3464 &size);
3465 else
3466 GetTextExtentPoint32 (hdc, title, strlen (title), &size);
3467
3461 pMis->itemWidth = size.cx; 3468 pMis->itemWidth = size.cx;
3462 if (pMis->itemHeight < size.cy) 3469 if (pMis->itemHeight < size.cy)
3463 pMis->itemHeight = size.cy; 3470 pMis->itemHeight = size.cy;
3464 } 3471 }
3465 else 3472 else
3493 GetObject (menu_font, sizeof (menu_logfont), &menu_logfont); 3500 GetObject (menu_font, sizeof (menu_logfont), &menu_logfont);
3494 menu_logfont.lfWeight = FW_BOLD; 3501 menu_logfont.lfWeight = FW_BOLD;
3495 menu_font = CreateFontIndirect (&menu_logfont); 3502 menu_font = CreateFontIndirect (&menu_logfont);
3496 old_font = SelectObject (hdc, menu_font); 3503 old_font = SelectObject (hdc, menu_font);
3497 3504
3498 /* Always draw title as if not selected. */ 3505 /* Always draw title as if not selected. */
3499 ExtTextOut (hdc, 3506 if (unicode_append_menu)
3500 pDis->rcItem.left 3507 ExtTextOutW (hdc,
3501 + GetSystemMetrics (SM_CXMENUCHECK), 3508 pDis->rcItem.left
3502 pDis->rcItem.top, 3509 + GetSystemMetrics (SM_CXMENUCHECK),
3503 ETO_OPAQUE, &pDis->rcItem, 3510 pDis->rcItem.top,
3504 title, strlen (title), NULL); 3511 ETO_OPAQUE, &pDis->rcItem,
3512 (WCHAR *) title,
3513 wcslen ((WCHAR *) title), NULL);
3514 else
3515 ExtTextOut (hdc,
3516 pDis->rcItem.left
3517 + GetSystemMetrics (SM_CXMENUCHECK),
3518 pDis->rcItem.top,
3519 ETO_OPAQUE, &pDis->rcItem,
3520 title, strlen (title), NULL);
3505 3521
3506 SelectObject (hdc, old_font); 3522 SelectObject (hdc, old_font);
3507 DeleteObject (menu_font); 3523 DeleteObject (menu_font);
3508 } 3524 }
3509 return TRUE; 3525 return TRUE;