- Sync up menu without the Right to Left support. Still missing needed changes for adding it.
- Patches by Alexandre Julliard and Dmitry Timoshkov.

svn path=/trunk/; revision=51461
This commit is contained in:
James Tabor 2011-04-26 03:31:15 +00:00
parent ee43f54510
commit 0f669f42d6

View file

@ -530,7 +530,6 @@ static UINT FASTCALL MenuFindItemByKey(HWND WndOwner, PROSMENUINFO MenuInfo,
}
if ( !ForceMenuChar )
{
Key = toupperW(Key);
ItemInfo = Items;
for (i = 0; i < MenuInfo->MenuItemCount; i++, ItemInfo++)
{
@ -541,27 +540,17 @@ static UINT FASTCALL MenuFindItemByKey(HWND WndOwner, PROSMENUINFO MenuInfo,
{
p = strchrW (p + 2, '&');
}
while (NULL != p && L'&' == p[1]);
if (NULL != p && (toupperW(p[1]) == Key))
{
return i;
}
while (p != NULL && p [1] == '&');
if (p && (toupperW(p[1]) == toupperW(Key))) return i;
}
}
}
MenuChar = SendMessageW(WndOwner, WM_MENUCHAR,
MAKEWPARAM(Key, MenuInfo->Flags), (LPARAM) MenuInfo->Self);
if (2 == HIWORD(MenuChar))
{
return LOWORD(MenuChar);
if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar);
if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2);
}
if (1 == HIWORD(MenuChar))
{
return (UINT) (-2);
}
}
return (UINT)(-1);
}
@ -1576,12 +1565,12 @@ static BOOL FASTCALL MenuShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, UINT fl
MenuInfo.FocusedItem = NO_SELECTED_ITEM;
}
/* ReactOS Check */
if (!ValidateHwnd(hwndOwner))
{ // This window maybe already DEAD!!!
/* store the owner for DrawItem */
if (!IsWindow(hwndOwner))
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return FALSE;
}
/* store the owner for DrawItem */
MenuInfo.WndOwner = hwndOwner;
MenuSetRosMenuInfo(&MenuInfo);
@ -3673,7 +3662,7 @@ VOID MenuTrackKbdMenuBar(HWND hwnd, UINT wParam, WCHAR wChar)
if( uItem == NO_SELECTED_ITEM )
MenuMoveSelection( hwnd, &MenuInfo, ITEM_NEXT );
else
PostMessageW( hwnd, WM_KEYDOWN, VK_DOWN, 0L );
PostMessageW( hwnd, WM_KEYDOWN, VK_RETURN, 0 );
}
track_menu: