Author: dquintana
Date: Tue Apr 22 17:44:19 2014
New Revision: 62891
URL:
http://svn.reactos.org/svn/reactos?rev=62891&view=rev
Log:
[RSHELL]
* Almost working keyboard navigation on horizontal menu bar. It does not yet switch
between menus when a submenu of the shell menu is currently open and you press [right].
CORE-7586
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Tue Apr 22
17:44:19 2014
@@ -715,23 +715,23 @@
if (popup == NULL)
return E_FAIL;
- DbgPrint("Before Query\n");
+ TRACE("Before Query\n");
hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
if (FAILED_UNEXPECTEDLY(hr))
{
- DbgPrint("Query failed\n");
+ TRACE("Query failed\n");
DestroyMenu(popup);
return hr;
}
HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow;
- DbgPrint("Before Tracking\n");
+ TRACE("Before Tracking\n");
uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, hwnd, NULL);
if (uCommand != 0)
{
- DbgPrint("Before InvokeCommand\n");
+ TRACE("Before InvokeCommand\n");
CMINVOKECOMMANDINFO cmi = { 0 };
cmi.cbSize = sizeof(cmi);
cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
@@ -740,7 +740,7 @@
}
else
{
- DbgPrint("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand,
GetLastError());
+ TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand,
GetLastError());
hr = S_FALSE;
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Tue
Apr 22 17:44:19 2014
@@ -288,7 +288,7 @@
DisableMouseTrack(NULL, FALSE);
if (isTracking && iHitTestResult>=0 && m_current->type
== TrackedMenuEntry)
SendMessage(entry->hwnd, WM_CANCELMODE, 0, 0);
- PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult, isTracking);
+ PostMessage(child, WM_USER_CHANGETRACKEDITEM, iHitTestResult,
MAKELPARAM(isTracking, TRUE));
if (m_current->type == TrackedMenuEntry)
return FALSE;
}
@@ -359,13 +359,13 @@
callNext = ProcessMouseMove(msg);
break;
case WM_INITMENUPOPUP:
- DbgPrint("WM_INITMENUPOPUP %p %p\n", msg->wParam,
msg->lParam);
+ TRACE("WM_INITMENUPOPUP %p %p\n", msg->wParam, msg->lParam);
m_selectedMenu = reinterpret_cast<HMENU>(msg->lParam);
m_selectedItem = -1;
m_selectedItemFlags = 0;
break;
case WM_MENUSELECT:
- DbgPrint("WM_MENUSELECT %p %p\n", msg->wParam, msg->lParam);
+ TRACE("WM_MENUSELECT %p %p\n", msg->wParam, msg->lParam);
m_selectedMenu = reinterpret_cast<HMENU>(msg->lParam);
m_selectedItem = GET_X_LPARAM(msg->wParam);
m_selectedItemFlags = HIWORD(msg->wParam);
@@ -621,7 +621,7 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- DbgPrint("PushTrackedPopup %p\n", popup);
+ TRACE("PushTrackedPopup %p\n", popup);
m_selectedMenu = popup;
m_selectedItem = -1;
m_selectedItemFlags = 0;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Apr 22
17:44:19 2014
@@ -131,7 +131,7 @@
return IsTrackedItem(wParam);
case WM_USER_CHANGETRACKEDITEM:
m_SubclassOld(hWnd, uMsg, wParam, lParam);
- return ChangeTrackedItem(wParam, lParam);
+ return ChangeTrackedItem(wParam, LOWORD(lParam), HIWORD(lParam));
case WM_COMMAND:
OnWinEvent(hWnd, uMsg, wParam, lParam, &lr);
@@ -604,6 +604,7 @@
SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0);
}
+ TRACE("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem,
toolbar, item);
m_hotBar = toolbar;
m_hotItem = item;
@@ -690,7 +691,7 @@
return S_FALSE;
}
-HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking)
+HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse)
{
TBBUTTON btn;
@@ -703,9 +704,9 @@
if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index,
reinterpret_cast<LPARAM>(&btn)))
return E_FAIL;
- DbgPrint("ChangeTrackedItem %d, %d\n", index, wasTracking);
+ TRACE("ChangeTrackedItem %d, %d\n", index, wasTracking);
m_isTrackingPopup = wasTracking;
- return m_menuBand->_ChangeHotItem(this, btn.idCommand, HICF_MOUSE);
+ return m_menuBand->_ChangeHotItem(this, btn.idCommand, mouse ? HICF_MOUSE : 0);
}
HRESULT CMenuToolbarBase::PopupSubMenu(UINT iItem, UINT index, IShellMenu*
childShellMenu)
@@ -912,13 +913,13 @@
{
if (prev != btn.idCommand)
{
- DbgPrint("Setting Hot item to %d\n", index);
+ TRACE("Setting Hot item to %d\n", index);
if (!(m_initFlags & SMINIT_VERTICAL) &&
m_isTrackingPopup)
{
HWND tlw;
m_menuBand->_GetTopLevelWindow(&tlw);
SendMessage(tlw, WM_CANCELMODE, 0, 0);
- PostMessage(m_hwndToolbar, WM_USER_CHANGETRACKEDITEM, index,
m_isTrackingPopup);
+ PostMessage(m_hwndToolbar, WM_USER_CHANGETRACKEDITEM, index,
MAKELPARAM(m_isTrackingPopup, FALSE));
}
else
m_menuBand->_ChangeHotItem(this, btn.idCommand, 0);
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Apr 22
17:44:19 2014
@@ -78,7 +78,7 @@
HRESULT KeyboardItemChange(DWORD changeType);
HRESULT IsTrackedItem(INT index);
- HRESULT ChangeTrackedItem(INT index, BOOL wasTracking);
+ HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse);
HRESULT GetSizes(SIZE* pMinSize, SIZE* pMaxSize, SIZE* pIntegralSize);
HRESULT SetPosSize(int x, int y, int cx, int cy);