diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index a5c5f6750f4..18e57611ff5 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -439,7 +439,7 @@ NtUserDrawMenuBarTemp( HDC hDC, PRECT hRect, HMENU hMenu, - DWORD Unknown4); + HFONT hFont); DWORD STDCALL diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 073ce7e8205..419747aabe6 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.61 2003/08/06 13:17:43 weiden Exp $ +/* $Id: defwnd.c,v 1.62 2003/08/06 18:43:57 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -449,6 +449,7 @@ DefWndDoPaintNC(HWND hWnd, HRGN clip) RECT rect; ULONG Style; ULONG ExStyle; + int wFrame = 0; Active = GetWindowLongW(hWnd, GWL_STYLE) & WIN_NCACTIVATED; Style = GetWindowLong(hWnd, GWL_STYLE); @@ -471,10 +472,12 @@ DefWndDoPaintNC(HWND hWnd, HRGN clip) if (UserHasThickFrameStyle(Style, ExStyle)) { UserDrawFrameNC(hWnd, &rect, FALSE, Active); + wFrame = GetSystemMetrics(SM_CXSIZEFRAME); } else if (UserHasDlgFrameStyle(Style, ExStyle)) { UserDrawFrameNC(hWnd, &rect, TRUE, Active); + wFrame = GetSystemMetrics(SM_CXDLGFRAME); } if (Style & WS_CAPTION) { @@ -490,6 +493,8 @@ DefWndDoPaintNC(HWND hWnd, HRGN clip) { RECT r = rect; r.bottom = rect.top + GetSystemMetrics(SM_CYMENU); + r.left += wFrame; + r.right -= wFrame; rect.top += MenuDrawMenuBar(hDC, &r, hWnd, FALSE); } diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index 6e515558c51..a0e524ae46f 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/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.19 2003/08/06 13:17:43 weiden Exp $ +/* $Id: menu.c,v 1.20 2003/08/06 18:43:57 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/menu.c @@ -302,59 +302,13 @@ MenuGetMenuBarHeight(HWND hWnd, ULONG MenuBarWidth, LONG OrgX, LONG OrgY) UINT MenuDrawMenuBar(HDC hDC, LPRECT Rect, HWND hWnd, BOOL Draw) { - HFONT hFontOld = SelectObject(hDC, hMenuFont); - //DrawTextA(hDC, "This is the menu bar", 19, Rect, DT_SINGLELINE); - SelectObject(hDC, hFontOld); - return(GetSystemMetrics(SM_CYMENU)); - /* - ULONG MenuID; - PPOPUP_MENU Menu; - HFONT hFontOld; - ULONG i; + /* FIXME cache menu bar items using NtUserDrawMenuBarTemp() */ - MenuID = GetWindowLong(hWnd, GWL_ID); - Menu = MenuGetMenu((HMENU)MenuID); + /* FIXME select menu font first */ + + DrawTextW(hDC, L"FIXME: Draw Menubar", -1, Rect, DT_SINGLELINE | DT_VCENTER); - if (Menu == NULL || Rect == NULL) - { - return(GetSystemMetrics(SM_CYMENU)); - } - - hFontOld = SelectObject(hDC, hMenuFont); - - if (Menu->Height == 0) - { - MenuMenuBarCalcSize(hDC, Rect, Menu, hWnd); - } - - Rect->bottom = Rect->top + Menu->Height; - - if (!Draw) - { - SelectObject(hDC, hFontOld); - return(Menu->Height); - } - - FillRect(hDC, Rect, GetSysColorBrush(COLOR_MENU)); - - SelectObject(hDC, GetSysColorPen(COLOR_WINDOWFRAME)); - MoveToEx(hDC, Rect->left, Rect->bottom, NULL); - LineTo(hDC, Rect->right, Rect->bottom); - - if (Menu->NrItems == 0) - { - SelectObject(hDC, hFontOld); - return(GetSystemMetrics(SM_CYMENU)); - } - - for (i = 0; i < Menu->NrItems; i++) - { - MenuDrawMenuItem(hWnd, (HMENU)MenuID, hWnd, hDC, - Menu->Items + i, Menu->Height, TRUE, ODA_DRAWENTIRE); - } - - SelectObject(hDC, hFontOld); - return(Menu->Height);*/ + return(Rect->bottom - Rect->top); } diff --git a/reactos/subsys/win32k/include/menu.h b/reactos/subsys/win32k/include/menu.h index 513b9138a31..687ff13a024 100644 --- a/reactos/subsys/win32k/include/menu.h +++ b/reactos/subsys/win32k/include/menu.h @@ -130,7 +130,7 @@ NtUserDrawMenuBarTemp( HDC hDC, PRECT hRect, HMENU hMenu, - DWORD Unknown4); + HFONT hFont); UINT STDCALL diff --git a/reactos/subsys/win32k/ntuser/menu.c b/reactos/subsys/win32k/ntuser/menu.c index 7d122f037e8..835fea09da1 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.11 2003/08/06 13:17:44 weiden Exp $ +/* $Id: menu.c,v 1.12 2003/08/06 18:43:58 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -101,7 +101,7 @@ CleanupMenuImpl(VOID) return(STATUS_SUCCESS); } -#if 1 +#if 0 void FASTCALL DumpMenuItemList(PMENU_ITEM MenuItem) { @@ -532,7 +532,7 @@ W32kInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, WINBOOL fByPosition, } pos = W32kInsertMenuItemToList(MenuObject, MenuItem, pos); - DumpMenuItemList(MenuObject->MenuItemList); + return pos >= 0; } diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index b26ddca6d06..40c8252acfb 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.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: window.c,v 1.79 2003/08/06 16:47:35 weiden Exp $ +/* $Id: window.c,v 1.80 2003/08/06 18:43:58 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -2199,10 +2199,10 @@ NtUserDrawMenuBarTemp( HDC hDC, PRECT hRect, HMENU hMenu, - DWORD Unknown4) + HFONT hFont) { + /* we'll use this function just for caching the menu bar */ UNIMPLEMENTED - return 0; }