diff --git a/reactos/lib/user32/windows/mdi.c b/reactos/lib/user32/windows/mdi.c index aa7b08ec27b..dea3edd2096 100644 --- a/reactos/lib/user32/windows/mdi.c +++ b/reactos/lib/user32/windows/mdi.c @@ -1091,7 +1091,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) WND* child = WIN_FindWndPtr(hChild); #endif HMENU hSysPopup = 0; - HBITMAP hSysMenuBitmap = 0; + HBITMAP hSysMenuBitmap = 0; TRACE("frame %p,child %p\n",frame,hChild); @@ -1120,10 +1120,9 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) SC_RESTORE, (LPSTR)(DWORD)HBMMENU_MBAR_RESTORE ); /* In Win 95 look, the system menu is replaced by the child icon */ - -/* FIXME */ #ifndef __REACTOS__ if(TWEAK_WineLook > WIN31_LOOK) +#endif { HICON hIcon = (HICON)GetClassLongA(hChild, GCL_HICONSM); if (!hIcon) @@ -1154,6 +1153,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) } } } +#ifndef __REACTOS__ else hSysMenuBitmap = hBmpClose; #endif diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index 4e4a4e73cdf..54a779e0f4f 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/menu.c @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: menu.c,v 1.65 2004/05/03 22:16:09 gvg Exp $ +/* $Id: menu.c,v 1.66 2004/05/13 20:21:27 navaraf Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/menu.c @@ -436,8 +436,9 @@ MenuGetBitmapItemSize(UINT Id, DWORD Data, SIZE *Size) case (INT_PTR) HBMMENU_MBAR_MINIMIZE_D: case (INT_PTR) HBMMENU_MBAR_CLOSE: case (INT_PTR) HBMMENU_MBAR_CLOSE_D: - Size->cx = GetSystemMetrics(SM_CXSIZE); - Size->cy = GetSystemMetrics(SM_CYSIZE); + /* FIXME: Why we need to subtract these magic values? */ + Size->cx = GetSystemMetrics(SM_CXSIZE) - 2; + Size->cy = GetSystemMetrics(SM_CYSIZE) - 4; return; case (INT_PTR) HBMMENU_CALLBACK: case (INT_PTR) HBMMENU_POPUP_CLOSE: @@ -480,6 +481,7 @@ MenuDrawBitmapItem(HDC Dc, PROSMENUITEMINFO Item, const RECT *Rect, BOOL MenuBar UINT Flags = 0; RECT r; + r = *Rect; switch ((int) Item->hbmpItem) { case (INT_PTR) HBMMENU_SYSTEM: @@ -507,9 +509,11 @@ MenuDrawBitmapItem(HDC Dc, PROSMENUITEMINFO Item, const RECT *Rect, BOOL MenuBar Flags = DFCS_CAPTIONRESTORE; break; case (INT_PTR) HBMMENU_MBAR_MINIMIZE: + r.right += 1; Flags = DFCS_CAPTIONMIN; break; case (INT_PTR) HBMMENU_MBAR_MINIMIZE_D: + r.right += 1; Flags = DFCS_CAPTIONMIN | DFCS_INACTIVE; break; case (INT_PTR) HBMMENU_MBAR_CLOSE: @@ -527,7 +531,6 @@ MenuDrawBitmapItem(HDC Dc, PROSMENUITEMINFO Item, const RECT *Rect, BOOL MenuBar FIXME("Magic menu bitmap not implemented\n"); return; } - r = *Rect; InflateRect(&r, -1, -1); if (0 != (Item->fState & MF_HILITE)) { @@ -1238,6 +1241,11 @@ MenuCalcItemSize(HDC Dc, PROSMENUITEMINFO ItemInfo, HWND WndOwner, /* Leave space for the sunken border */ ItemInfo->Rect.right += 2; ItemInfo->Rect.bottom += 2; + + /* Special case: Minimize button doesn't have a space behind it. */ + if (ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE || + ItemInfo->hbmpItem == (HBITMAP)HBMMENU_MBAR_MINIMIZE_D) + ItemInfo->Rect.right -= 1; } /* it must be a text item - unless it's the system menu */ @@ -1463,6 +1471,8 @@ MenuMenuBarCalcSize(HDC Dc, LPRECT Rect, PROSMENUINFO MenuInfo, HWND WndOwner) } } +/* FIXME: Is this really needed? */ +#if 0 /* Finish the line (set all items to the largest height found) */ while (Start < i) { @@ -1473,6 +1483,9 @@ MenuMenuBarCalcSize(HDC Dc, LPRECT Rect, PROSMENUINFO MenuInfo, HWND WndOwner) } Start++; } +#else + Start = i; +#endif } Rect->bottom = MaxY; diff --git a/reactos/subsys/win32k/ntuser/menu.c b/reactos/subsys/win32k/ntuser/menu.c index 2137202afd8..156c59d9fa3 100644 --- a/reactos/subsys/win32k/ntuser/menu.c +++ b/reactos/subsys/win32k/ntuser/menu.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: menu.c,v 1.54 2004/05/10 17:07:18 weiden Exp $ +/* $Id: menu.c,v 1.55 2004/05/13 20:21:27 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -845,6 +845,9 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition, return FALSE; } + /* Force size recalculation! */ + MenuObject->MenuInfo.Height = 0; + pos = IntInsertMenuItemToList(MenuObject, MenuItem, pos); return pos >= 0;