mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
some work on menus
svn path=/trunk/; revision=5443
This commit is contained in:
parent
bd3582207d
commit
2f728ecc17
6 changed files with 20 additions and 61 deletions
|
@ -439,7 +439,7 @@ NtUserDrawMenuBarTemp(
|
|||
HDC hDC,
|
||||
PRECT hRect,
|
||||
HMENU hMenu,
|
||||
DWORD Unknown4);
|
||||
HFONT hFont);
|
||||
|
||||
DWORD
|
||||
STDCALL
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ NtUserDrawMenuBarTemp(
|
|||
HDC hDC,
|
||||
PRECT hRect,
|
||||
HMENU hMenu,
|
||||
DWORD Unknown4);
|
||||
HFONT hFont);
|
||||
|
||||
UINT
|
||||
STDCALL
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue