menu: take the MF_DEFAULT flag in to account in MENU_CalcItemSize

Rein Klazes wijn at wanadoo.nl
Mon Feb 20 12:19:36 CST 2006


Hi,

Changelog:
dlls/user	: menu.c
In MENU_CalcItemSize() take the MF_DEFAULT flag in to account.

Rein.
-------------- next part --------------
--- wine/dlls/user/menu.c	2006-02-20 13:46:04.000000000 +0100
+++ mywine/dlls/user/menu.c	2006-02-20 17:44:32.000000000 +0100
@@ -1026,10 +1026,14 @@ static void MENU_CalcItemSize( HDC hdc, 
 
     /* it must be a text item - unless it's the system menu */
     if (!(lpitem->fType & MF_SYSMENU) && lpitem->text) {
+        HFONT hfontOld = NULL;
         RECT rc = lpitem->rect;
         LONG txtheight, txtwidth;
 
         lpitem->xTab = 0;
+	if ( lpitem->fState & MFS_DEFAULT ) {
+	     hfontOld = SelectObject( hdc, get_menu_font(TRUE) );
+	}
         if (menuBar) {
             txtheight = DrawTextW( hdc, lpitem->text, -1, &rc,
                     DT_SINGLELINE|DT_CALCRECT); 
@@ -1071,6 +1075,7 @@ static void MENU_CalcItemSize( HDC hdc, 
             itemheight = max( itemheight,
                     max( txtheight + 2, menucharsize.cy + 4));
         }
+	if (hfontOld) SelectObject (hdc, hfontOld);
     } else if( menuBar) {
         itemheight = max( itemheight, GetSystemMetrics(SM_CYMENU)-1);
     }


More information about the wine-patches mailing list