- Utilize the new menu structures and use item array instead of the list method. Make sure your applications Appends are in order (reference Mdi.c). Sync ported more wine code too.
- See CORE-5605, CORE-7447, CORE-7967 (Main Bug), CORE-8098 and CORE-8107

svn path=/trunk/; revision=63179
This commit is contained in:
James Tabor 2014-05-06 18:09:07 +00:00
parent 268e540974
commit 5e23122314
8 changed files with 921 additions and 1481 deletions

View file

@ -329,7 +329,6 @@ typedef struct tagITEM
INT cyBmp; /* Height " */
//// ReactOS
UNICODE_STRING lpstr;
struct tagITEM *Next;
} ITEM, *PITEM;
typedef struct tagMENULIST
@ -369,7 +368,7 @@ typedef struct tagMENU
DWORD dwArrowsOn:2; /* Arrows: 0 off, 1 on, 2 to the top, 3 to the bottom. */
//// ReactOS
LIST_ENTRY ListEntry;
HWND hWnd; /* Window containing the menu */
HWND hWnd; /* Window containing the menu, use POPUPMENU */
BOOL TimeToHide;
} MENU, *PMENU;

View file

@ -99,7 +99,7 @@ co_IntTranslateAccelerator(
/* Check if accelerator is associated with menu command */
hMenu = (Window->style & WS_CHILD) ? 0 : (HMENU)Window->IDMenu;
hSubMenu = NULL;
MenuObject = IntGetMenuObject(hMenu);
MenuObject = UserGetMenuObject(hMenu);
nPos = pAccel->cmd;
if (MenuObject)
{
@ -113,7 +113,7 @@ co_IntTranslateAccelerator(
/* Check system menu now */
hMenu = Window->SystemMenu;
hSubMenu = hMenu; /* system menu is a popup menu */
MenuObject = IntGetMenuObject(hMenu);
MenuObject = UserGetMenuObject(hMenu);
nPos = pAccel->cmd;
if (MenuObject)
{

File diff suppressed because it is too large Load diff

View file

@ -38,8 +38,7 @@ BOOL FASTCALL
IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
BOOL FASTCALL
IntInsertMenuItem(_In_ PMENU MenuObject, UINT uItem, BOOL fByPosition,
PROSMENUITEMINFO ItemInfo);
IntInsertMenuItem(_In_ PMENU MenuObject, UINT uItem, BOOL fByPosition, PROSMENUITEMINFO ItemInfo, PUNICODE_STRING lpstr);
PMENU FASTCALL
IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
@ -47,4 +46,4 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
UINT FASTCALL IntFindSubMenu(HMENU *hMenu, HMENU hSubTarget );
UINT FASTCALL IntGetMenuState( HMENU hMenu, UINT uId, UINT uFlags);
BOOL FASTCALL IntRemoveMenuItem(PMENU Menu, UINT uPosition, UINT uFlags, BOOL bRecurse);
PITEM MENU_FindItem( PMENU *pmenu, UINT *nPos, UINT wFlags );
PITEM FASTCALL MENU_FindItem( PMENU *pmenu, UINT *nPos, UINT wFlags );

View file

@ -1,6 +1,9 @@
#pragma once
PMENU FASTCALL UserGetMenuObject(HMENU hMenu);
FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
{
return ValidateHandle(hMenu, TYPE_MENU);
}
#define ASSERT_REFS_CO(_obj_) \
{ \

View file

@ -953,6 +953,11 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
SysMenu->fFlags |= MNF_SYSDESKMN;
SysMenu->hWnd = Window->head.h;
hNewMenu = co_IntLoadSysMenuTemplate();
//if ( Window->ExStyle & WS_EX_MDICHILD )
//hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENUMDI");
// else
//hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENU");
// Do the rest in here.
if(!hNewMenu)
{
IntReleaseMenuObject(SysMenu);
@ -985,7 +990,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
ItemInfo.dwTypeData = NULL;
ItemInfo.cch = 0;
ItemInfo.hSubMenu = NewMenu->head.h;
IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo);
IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo, NULL);
Window->SystemMenu = SysMenu->head.h;

View file

@ -897,8 +897,11 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
nItems = GetMenuItemCount(menu) - 1;
iId = GetMenuItemID(menu,nItems) ;
if (iId == SC_RESTORE || iId == SC_CLOSE)
{
ERR("system buttons already exist\n");
return 0;
}
//// End
/* create a copy of sysmenu popup and insert it into frame menu bar */
if (!(hSysPopup = GetSystemMenu(hChild, FALSE)))
{
@ -907,21 +910,14 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
}
AppendMenuW(menu, MF_HELP | MF_BITMAP,
SC_MINIMIZE, (LPCWSTR)HBMMENU_MBAR_MINIMIZE ) ;
SC_CLOSE, is_close_enabled(hChild, hSysPopup) ?
(LPCWSTR)HBMMENU_MBAR_CLOSE : (LPCWSTR)HBMMENU_MBAR_CLOSE_D );
AppendMenuW(menu, MF_HELP | MF_BITMAP,
SC_RESTORE, (LPCWSTR)HBMMENU_MBAR_RESTORE );
AppendMenuW(menu, MF_HELP | MF_BITMAP,
SC_CLOSE, is_close_enabled(hChild, hSysPopup) ?
(LPCWSTR)HBMMENU_MBAR_CLOSE : (LPCWSTR)HBMMENU_MBAR_CLOSE_D );
SC_MINIMIZE, (LPCWSTR)HBMMENU_MBAR_MINIMIZE ) ;
/* The system menu is replaced by the child icon */
/* hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICONSM);
if (!hIcon)
hIcon = (HICON)GetClassLongPtrW(hChild, GCLP_HICON);
if (!hIcon)
hIcon = LoadIconW(NULL, IDI_APPLICATION);
*/
//// End
hIcon = (HICON)SendMessageW(hChild, WM_GETICON, ICON_SMALL, 0);
if (!hIcon)
hIcon = (HICON)SendMessageW(hChild, WM_GETICON, ICON_BIG, 0);
@ -990,7 +986,10 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild, HBITMAP hBmpClose )
nItems = GetMenuItemCount(menu) - 1;
iId = GetMenuItemID(menu,nItems) ;
if( !(iId == SC_RESTORE || iId == SC_CLOSE) )
{
ERR("no system buttons then nothing to do\n");
return 0;
}
/*
* Remove the system menu, If that menu is the icon of the window
@ -1534,9 +1533,7 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
case WM_CHILDACTIVATE:
case WM_SYSCOMMAND:
case WM_SHOWWINDOW:
#ifndef __REACTOS__
case WM_SETVISIBLE:
#endif
case WM_SIZE:
case WM_NEXTMENU:
case WM_SYSCHAR:
@ -1613,9 +1610,8 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
break;
case WM_SHOWWINDOW:
#ifndef __REACTOS__
case WM_SETVISIBLE:
#endif //// Commented out r57663
//// Commented out r57663
/*if (ci->hwndChildMaximized) ci->mdiFlags &= ~MDIF_NEEDUPDATE;
else*/ MDI_PostUpdate(client, ci, SB_BOTH+1);
break;

File diff suppressed because it is too large Load diff