Rein Klazes : menu: Take the MF_DEFAULT flag in to account in MENU_CalcItemSize.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 20 14:18:23 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 3a0b40fffb2894be48bfa36f72afe0b4821b074b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=3a0b40fffb2894be48bfa36f72afe0b4821b074b

Author: Rein Klazes <wijn at wanadoo.nl>
Date:   Mon Feb 20 19:19:36 2006 +0100

menu: Take the MF_DEFAULT flag in to account in MENU_CalcItemSize.

---

 dlls/user/menu.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/user/menu.c b/dlls/user/menu.c
index 2f58cb0..a72e922 100644
--- a/dlls/user/menu.c
+++ b/dlls/user/menu.c
@@ -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-cvs mailing list