- Fix more menu tests, missed flags and fix MIM_APPLYTOSUBMENUS.

svn path=/trunk/; revision=62527
This commit is contained in:
James Tabor 2014-03-18 02:56:48 +00:00
parent 05f6960a49
commit 13bd05110c
2 changed files with 17 additions and 6 deletions

View file

@ -454,7 +454,17 @@ IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi)
Menu->MenuInfo.dwStyle = lpmi->dwStyle; Menu->MenuInfo.dwStyle = lpmi->dwStyle;
if(lpmi->fMask & MIM_APPLYTOSUBMENUS) if(lpmi->fMask & MIM_APPLYTOSUBMENUS)
{ {
/* FIXME */ int i;
PMENU_ITEM item = Menu->MenuItemList;
for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next)
{
if ( item->fType & MF_POPUP ) // item->hSubMenu )
{
PMENU_OBJECT SubMenu;
if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue;
IntSetMenuInfo( SubMenu, lpmi);
}
}
} }
if (sizeof(MENUINFO) < lpmi->cbSize) if (sizeof(MENUINFO) < lpmi->cbSize)
{ {

View file

@ -931,7 +931,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
if(NewMenu) if(NewMenu)
{ {
Window->SystemMenu = NewMenu->MenuInfo.Self; Window->SystemMenu = NewMenu->MenuInfo.Self;
NewMenu->MenuInfo.Flags |= MF_SYSMENU; NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN;
NewMenu->MenuInfo.Wnd = Window->head.h; NewMenu->MenuInfo.Wnd = Window->head.h;
ret = NewMenu; ret = NewMenu;
//IntReleaseMenuObject(NewMenu); //IntReleaseMenuObject(NewMenu);
@ -950,7 +950,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
UserDestroyMenu(hSysMenu); UserDestroyMenu(hSysMenu);
return NULL; return NULL;
} }
SysMenu->MenuInfo.Flags |= MF_SYSMENU; SysMenu->MenuInfo.Flags |= MNF_SYSDESKMN;
SysMenu->MenuInfo.Wnd = Window->head.h; SysMenu->MenuInfo.Wnd = Window->head.h;
hNewMenu = co_IntLoadSysMenuTemplate(); hNewMenu = co_IntLoadSysMenuTemplate();
if(!hNewMenu) if(!hNewMenu)
@ -970,7 +970,8 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
NewMenu = IntCloneMenu(Menu); NewMenu = IntCloneMenu(Menu);
if(NewMenu) if(NewMenu)
{ {
NewMenu->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN | MNF_POPUP;
NewMenu->MenuInfo.dwStyle = MNS_CHECKORBMP;
IntReleaseMenuObject(NewMenu); IntReleaseMenuObject(NewMenu);
UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE);
@ -1426,7 +1427,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
OldMenu = IntGetMenuObject(Window->SystemMenu); OldMenu = IntGetMenuObject(Window->SystemMenu);
if(OldMenu) if(OldMenu)
{ {
OldMenu->MenuInfo.Flags &= ~ MF_SYSMENU; OldMenu->MenuInfo.Flags &= ~ MNF_SYSDESKMN;
IntReleaseMenuObject(OldMenu); IntReleaseMenuObject(OldMenu);
} }
} }
@ -1435,7 +1436,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
{ {
/* FIXME: Check window style, propably return FALSE? */ /* FIXME: Check window style, propably return FALSE? */
Window->SystemMenu = Menu->MenuInfo.Self; Window->SystemMenu = Menu->MenuInfo.Self;
Menu->MenuInfo.Flags |= MF_SYSMENU; Menu->MenuInfo.Flags |= MNF_SYSDESKMN;
} }
else else
Window->SystemMenu = (HMENU)0; Window->SystemMenu = (HMENU)0;