Author: dquintana
Date: Thu Mar 20 15:39:25 2014
New Revision: 62537
URL:
http://svn.reactos.org/svn/reactos?rev=62537&view=rev
Log:
[RSHELL]
* Improve mouse navigation of the menubar.
* Fix the menus.
* Fix the case for system includes (hopefully fixes).
CORE-7586
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuBand.h
branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h
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] Thu Mar 20
15:39:25 2014
@@ -19,7 +19,7 @@
*/
#include "precomp.h"
#include <windowsx.h>
-#include <CommonControls.h>
+#include <commoncontrols.h>
#include <shlwapi_undoc.h>
#include "CMenuBand.h"
@@ -333,13 +333,18 @@
HRESULT hr = S_OK;
if (m_staticToolbar != NULL)
+ {
hr = m_staticToolbar->ShowWindow(fShow);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+ }
+
if (m_SFToolbar != NULL)
+ {
hr = m_SFToolbar->ShowWindow(fShow);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+ }
if (fShow)
{
@@ -348,12 +353,10 @@
return hr;
}
- {
- if (fShow)
- hr = m_focusManager->PushMenu(this);
- else
- hr = m_focusManager->PopMenu(this);
- }
+ if (fShow)
+ hr = m_focusManager->PushMenu(this);
+ else
+ hr = m_focusManager->PopMenu(this);
return S_OK;
}
@@ -368,17 +371,6 @@
if (m_SFToolbar != NULL)
return m_SFToolbar->Close();
- return S_OK;
-}
-HRESULT STDMETHODCALLTYPE CMenuBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown
*punkToolbarSite, BOOL fReserved)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::ContextSensitiveHelp(BOOL fEnterMode)
-{
- UNIMPLEMENTED;
return S_OK;
}
@@ -492,6 +484,12 @@
return S_OK;
}
+HRESULT CMenuBand::_SetChildBand(CMenuBand * child)
+{
+ m_childBand = child;
+ return S_OK;
+}
+
HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient)
{
if (m_subMenuChild)
@@ -504,13 +502,13 @@
}
HRESULT hr = punkClient->QueryInterface(IID_PPV_ARG(IMenuPopup,
&m_subMenuChild));
m_trackingPopup = m_subMenuChild != NULL;
+ DbgPrint("Tracking: %d\n", m_trackingPopup);
return hr;
}
HRESULT STDMETHODCALLTYPE CMenuBand::GetClient(IUnknown **ppunkClient)
{
// HACK, so I can test for a submenu in the DeskBar
- //UNIMPLEMENTED;
if (ppunkClient)
{
if (m_subMenuChild)
@@ -523,15 +521,11 @@
HRESULT STDMETHODCALLTYPE CMenuBand::IsMenuMessage(MSG *pmsg)
{
- //UNIMPLEMENTED;
- //return S_OK;
return S_FALSE;
- //return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE CMenuBand::TranslateMenuMessage(MSG *pmsg, LRESULT *plRet)
{
- //UNIMPLEMENTED;
return S_FALSE;
}
@@ -569,24 +563,6 @@
if (m_SFToolbar)
return m_SFToolbar->GetShellFolder(pdwFlags, ppidl, riid, ppv);
return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetState(LPSMDATA psmd)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetMenuToolbar(IUnknown *punk, DWORD dwFlags)
-{
- UNIMPLEMENTED;
- return S_OK;
}
HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT *theResult)
@@ -663,6 +639,8 @@
UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
m_trackingPopup = TRUE;
+ DbgPrint("Tracking: %d\n", m_trackingPopup);
+
m_focusManager->PushTrackedPopup(this, popup);
if (m_menuOwner)
{
@@ -672,8 +650,10 @@
{
::TrackPopupMenuEx(popup, flags, x, y, m_topLevelWindow, ¶ms);
}
+ m_focusManager->PopTrackedPopup(this, popup);
+
m_trackingPopup = FALSE;
- m_focusManager->PopTrackedPopup(this, popup);
+ DbgPrint("Tracking: %d\n", m_trackingPopup);
return S_OK;
}
@@ -812,11 +792,8 @@
{
if (m_hotBar && m_hotItem >= 0)
{
- if (m_hotBar->HasSubMenu(m_hotItem)==S_OK)
- {
- m_hotBar->PopupItem(m_hotItem);
+ if (m_hotBar->PopupItem(m_hotItem) == S_OK)
return S_FALSE;
- }
}
if (!m_subMenuParent)
return S_OK;
@@ -839,9 +816,14 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
}
+
if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(toolbar, item);
if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(toolbar, item);
+
+ m_subMenuChild = popup;
m_trackingPopup = popup != NULL;
+ DbgPrint("Tracking: %d\n", m_trackingPopup);
+
if (popup)
{
if (m_subMenuParent)
@@ -851,6 +833,7 @@
popup->Popup(pAt, pExclude, MPPF_RIGHT);
}
+
return S_OK;
}
@@ -863,6 +846,36 @@
return S_OK;
}
+HRESULT STDMETHODCALLTYPE CMenuBand::InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetState(LPSMDATA psmd)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::SetMenuToolbar(IUnknown *punk, DWORD dwFlags)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown
*punkToolbarSite, BOOL fReserved)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::ContextSensitiveHelp(BOOL fEnterMode)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
HRESULT STDMETHODCALLTYPE CMenuBand::GetSubMenu(THIS)
{
UNIMPLEMENTED;
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Thu Mar 20
15:39:25 2014
@@ -47,6 +47,7 @@
CComPtr<IShellMenuCallback> m_psmc;
CComPtr<IMenuPopup> m_subMenuChild;
CComPtr<IMenuPopup> m_subMenuParent;
+ CComPtr<CMenuBand> m_childBand;
UINT m_uId;
UINT m_uIdAncestor;
@@ -178,6 +179,7 @@
HRESULT _MenuItemHotTrack(DWORD changeType);
HRESULT _OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude,
CMenuToolbarBase * toolbar, INT item);
HRESULT _DisableMouseTrack(BOOL bDisable);
+ HRESULT _SetChildBand(CMenuBand * child);
BOOL UseBigIcons()
{
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] Thu
Mar 20 15:39:25 2014
@@ -19,7 +19,7 @@
*/
#include "precomp.h"
#include <windowsx.h>
-#include <CommonControls.h>
+#include <commoncontrols.h>
#include <shlwapi_undoc.h>
#include "CMenuFocusManager.h"
@@ -194,13 +194,56 @@
return S_FALSE;
}
-LRESULT CMenuFocusManager::MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam)
+LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg)
{
HWND parent;
HWND child;
POINT pt;
int iHitTestResult;
+ pt = msg->pt;
+
+ parent = WindowFromPoint(pt);
+
+ ScreenToClient(parent, &pt);
+
+ child = ChildWindowFromPoint(parent, pt);
+
+ if (child != m_parentToolbar)
+ return TRUE;
+
+ ScreenToClient(m_parentToolbar, &msg->pt);
+
+ /* Don't do anything if the mouse has not been moved */
+ if (msg->pt.x == m_ptPrev.x && msg->pt.y == m_ptPrev.y)
+ return TRUE;
+
+ m_ptPrev = msg->pt;
+
+ iHitTestResult = SendMessageW(m_parentToolbar, TB_HITTEST, 0, (LPARAM)
&msg->pt);
+
+ /* Make sure that iHitTestResult is one of the menu items and that it is not the
current menu item */
+ if (iHitTestResult >= 0)
+ {
+ HWND hwndToolbar = m_parentToolbar;
+ if (SendMessage(hwndToolbar, WM_USER_ISTRACKEDITEM, iHitTestResult, 0))
+ {
+ DbgPrint("Hot item tracking detected a change...\n");
+ if (m_currentMenu)
+ SendMessage(m_currentFocus, WM_CANCELMODE, 0, 0);
+ else
+ m_currentBand->_MenuItemHotTrack(MPOS_SELECTLEFT);
+ DbgPrint("Active popup cancelled, notifying of change...\n");
+ PostMessage(hwndToolbar, WM_USER_CHANGETRACKEDITEM, iHitTestResult,
iHitTestResult);
+ return TRUE;
+ }
+ }
+
+ return TRUE;
+}
+
+LRESULT CMenuFocusManager::MsgFilterHook(INT nCode, WPARAM wParam, LPARAM lParam)
+{
if (nCode < 0)
return CallNextHookEx(m_hMsgFilterHook, nCode, wParam, lParam);
@@ -214,38 +257,7 @@
switch (msg->message)
{
case WM_MOUSEMOVE:
-
- pt = msg->pt;
-
- parent = WindowFromPoint(pt);
-
- ScreenToClient(parent, &pt);
-
- child = ChildWindowFromPoint(parent, pt);
-
- if (child != m_parentToolbar)
- break;
-
- ScreenToClient(m_parentToolbar, &msg->pt);
-
- /* Don't do anything if the mouse has not been moved */
- if (msg->pt.x == m_ptPrev.x && msg->pt.y == m_ptPrev.y)
- return TRUE;
-
- m_ptPrev = msg->pt;
-
- iHitTestResult = SendMessageW(m_parentToolbar, TB_HITTEST, 0, (LPARAM)
&msg->pt);
-
- /* Make sure that iHitTestResult is one of the menu items and that it is not
the current menu item */
- if (iHitTestResult >= 0)
- {
- if (SendMessage(m_parentToolbar, WM_USER_ISTRACKEDITEM, iHitTestResult,
0))
- {
- SendMessage(m_currentFocus, WM_CANCELMODE, 0, 0);
- PostMessage(m_parentToolbar, WM_USER_CHANGETRACKEDITEM,
iHitTestResult, iHitTestResult);
- return TRUE;
- }
- }
+ callNext = ProcessMouseMove(msg);
break;
}
@@ -309,6 +321,7 @@
DisableMouseTrack(NULL, FALSE);
}
}
+ callNext = ProcessMouseMove(msg);
break;
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
@@ -351,10 +364,12 @@
//SetCapture(window);
if (m_currentMenu)
{
+ DbgPrint("Entering MSGFILTER hook...\n");
m_hMsgFilterHook = SetWindowsHookEx(WH_MSGFILTER, s_MsgFilterHook, NULL,
m_threadId);
}
else
{
+ DbgPrint("Entering GETMESSAGE hook...\n");
m_hGetMsgHook = SetWindowsHookEx(WH_GETMESSAGE, s_GetMsgHook, NULL, m_threadId);
}
return S_OK;
@@ -362,6 +377,7 @@
HRESULT CMenuFocusManager::RemoveHooks()
{
+ DbgPrint("Removing all hooks...\n");
if (m_hMsgFilterHook)
UnhookWindowsHookEx(m_hMsgFilterHook);
if (m_hGetMsgHook)
@@ -388,9 +404,14 @@
m_currentBand = newBand;
m_currentMenu = popupToTrack;
m_currentFocus = newFocus;
- if (m_currentMenu)
+ m_parentToolbar = NULL;
+ if (popupToTrack)
{
m_currentBand->GetWindow(&m_parentToolbar);
+ }
+ else if (m_bandCount >= 2)
+ {
+ m_bandStack[m_bandCount - 2]->GetWindow(&m_parentToolbar);
}
if (oldFocus && (!newFocus || (oldMenu != popupToTrack)))
@@ -425,7 +446,7 @@
if (mbParent)
{
- mbParent->SetClient(static_cast<IMenuPopup*>(mb));
+ mbParent->_SetChildBand(mb);
}
return UpdateFocus(mb);
@@ -466,7 +487,7 @@
if (mb)
{
- mb->SetClient(NULL);
+ mb->_SetChildBand(NULL);
}
return S_OK;
@@ -515,10 +536,5 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- if (mb)
- {
- mb->SetClient(NULL);
- }
-
return S_OK;
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.h [iso-8859-1] Thu Mar
20 15:39:25 2014
@@ -44,8 +44,8 @@
HWND m_currentFocus;
HMENU m_currentMenu;
HWND m_parentToolbar;
+ HHOOK m_hMsgFilterHook;
HHOOK m_hGetMsgHook;
- HHOOK m_hMsgFilterHook;
DWORD m_threadId;
BOOL m_mouseTrackDisabled;
WPARAM m_lastMoveFlags;
@@ -82,6 +82,7 @@
void DisableMouseTrack(HWND enableTo, BOOL disableThis);
+ LRESULT ProcessMouseMove(MSG* msg);
public:
HRESULT PushMenu(CMenuBand * mb);
HRESULT PopMenu(CMenuBand * mb);
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] Thu Mar 20
15:39:25 2014
@@ -19,7 +19,7 @@
*/
#include "precomp.h"
#include <windowsx.h>
-#include <CommonControls.h>
+#include <commoncontrols.h>
#include <shlwapi_undoc.h>
#include "CMenuBand.h"
@@ -84,8 +84,7 @@
return S_OK;
case TBN_DROPDOWN:
- wParam = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem;
- return OnCommand(wParam, 0, theResult);
+ return OnCommand(reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem, 0,
theResult);
case TBN_HOTITEMCHANGE:
return OnHotItemChange(reinterpret_cast<LPNMTBHOTITEM>(hdr),
theResult);
@@ -99,8 +98,30 @@
case RBN_CHILDSIZE:
return S_OK;
+ case NM_RELEASEDCAPTURE:
+ break;
+
+ case NM_RDOWN:
+ case NM_LDOWN:
+ break;
+
+ case TBN_GETDISPINFO:
+ break;
+
+ case TBN_BEGINDRAG:
+ case TBN_ENDDRAG:
+ break;
+
+ case NM_TOOLTIPSCREATED:
+ break;
+
+ case TBN_GETINFOTIP:
+ // TODO: Get tooltip for item
+ break;
+
default:
DbgPrint("WM_NOTIFY unknown code %d, %d\n", hdr->code,
hdr->idFrom);
+ break;
}
return S_OK;
}
@@ -406,7 +427,6 @@
m_SubclassOld(hWnd, uMsg, wParam, lParam);
return IsTrackedItem(wParam);
case WM_USER_CHANGETRACKEDITEM:
- m_isTracking = TRUE;
m_SubclassOld(hWnd, uMsg, wParam, lParam);
return ChangeTrackedItem(wParam);
@@ -423,10 +443,7 @@
m_menuBand->_OnPopupSubMenu(NULL, NULL, NULL, NULL, -1);
- if (HasSubMenu(m_hotItem) == S_OK)
- {
- PopupItem(m_hotItem);
- }
+ PopupItem(m_hotItem);
}
}
@@ -448,17 +465,20 @@
if (m_menuBand->_OnHotItemChanged(NULL, -1) == S_FALSE)
{
*theResult = 1;
- return S_OK;
}
else
{
- m_hotItem = -1;
+ m_menuBand->_OnHotItemChanged(NULL, -1);
m_menuBand->_MenuItemHotTrack(MPOS_CHILDTRACKING);
- return S_OK;
- }
- }
- else if (m_hotItem != hot->idNew)
- {
+ }
+
+ return S_OK;
+ }
+
+ if (m_hotItem != hot->idNew)
+ {
+ DbgPrint("Hot item is now %d\n", hot->idNew);
+
if (hot->dwFlags & HICF_MOUSE &&
m_toolbarFlags & SMINIT_VERTICAL)
{
@@ -467,8 +487,7 @@
SetTimer(m_hwndToolbar, TIMERID_HOTTRACK, elapsed, NULL);
}
- m_hotItem = hot->idNew;
- m_menuBand->_OnHotItemChanged(this, m_hotItem);
+ m_menuBand->_OnHotItemChanged(this, hot->idNew);
m_menuBand->_MenuItemHotTrack(MPOS_CHILDTRACKING);
if (m_isTracking && !(m_toolbarFlags & SMINIT_VERTICAL))
@@ -477,13 +496,11 @@
m_menuBand->_OnPopupSubMenu(NULL, NULL, NULL, NULL, -1);
- if (HasSubMenu(m_hotItem) == S_OK)
- {
- PopupItem(m_hotItem);
- }
+ PopupItem(m_hotItem);
}
return S_OK;
}
+
return S_OK;
}
@@ -514,6 +531,7 @@
{
SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_popupItem, FALSE);
m_isTracking = FALSE;
+ DbgPrint("Is Tracking: %d\n", m_isTracking);
}
m_popupBar = toolbar;
m_popupItem = item;
@@ -542,6 +560,9 @@
if (m_hotItem != btn.idCommand)
{
+ m_isTracking = TRUE;
+ DbgPrint("Is Tracking: %d\n", m_isTracking);
+
SendMessage(m_hwndToolbar, TB_SETHOTITEM, index, 0);
}
return S_OK;
@@ -626,6 +647,8 @@
return hr;
m_isTracking = TRUE;
+ DbgPrint("Is Tracking: %d\n", m_isTracking);
+
m_menuBand->_OnPopupSubMenu(popup, &pt, &rcl, this, uItem);
return S_OK;
@@ -663,10 +686,14 @@
HMENU popup = GetSubMenu(menu, index);
m_isTracking = TRUE;
+ DbgPrint("Is Tracking: %d\n", m_isTracking);
+
m_menuBand->_TrackSubMenuUsingTrackPopupMenu(popup, pt.x, pt.y, rcl);
SendMessage(m_hwndToolbar, TB_CHECKBUTTON, uItem, FALSE);
+
m_isTracking = FALSE;
+ DbgPrint("Is Tracking: %d\n", m_isTracking);
return S_OK;
}
@@ -704,15 +731,17 @@
HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult)
{
theResult = 0;
- if (HasSubMenu(wParam) == S_OK)
- {
- KillTimer(m_hwndToolbar, TIMERID_HOTTRACK);
- PopupItem(wParam);
+
+ KillTimer(m_hwndToolbar, TIMERID_HOTTRACK);
+
+ if (PopupItem(wParam) == S_OK)
return S_FALSE;
- }
+
HRESULT hr = m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
return S_OK; // filter out a possible S_FALSE from here.
}
@@ -866,8 +895,11 @@
HRESULT CMenuToolbarBase::GetDataFromId(INT uItem, INT* pIndex, DWORD_PTR* pData)
{
TBBUTTONINFO info = { 0 };
+ DbgPrint("GetDataFromId %d\n", uItem);
+
info.cbSize = sizeof(TBBUTTONINFO);
- info.dwMask = 0;
+ info.dwMask = TBIF_COMMAND | TBIF_LPARAM;
+
int index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, uItem,
reinterpret_cast<LPARAM>(&info));
if (index < 0)
return E_FAIL;
@@ -876,41 +908,31 @@
*pIndex = index;
if (pData)
- {
- TBBUTTON btn = { 0 };
- if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index,
reinterpret_cast<LPARAM>(&btn)))
- return E_FAIL;
- *pData = btn.dwData;
- }
-
- return S_OK;
-}
-
+ *pData = info.lParam;
+
+ DbgPrint("GetDataFromId ret: %d, %d, %x, %x\n", info.idCommand, index,
info.lParam);
+
+ return S_OK;
+}
HRESULT CMenuToolbarBase::PopupItem(INT uItem)
{
INT index;
DWORD_PTR dwData;
+ GetDataFromId(uItem, &index, &dwData);
+
if (!(m_toolbarFlags & SMINIT_VERTICAL))
{
- SendMessage(m_hwndToolbar, TB_SETHOTITEM, uItem, 0);
+ SendMessage(m_hwndToolbar, TB_SETHOTITEM, index, 0);
SendMessage(m_hwndToolbar, TB_CHECKBUTTON, uItem, TRUE);
}
- GetDataFromId(uItem, &index, &dwData);
+ HRESULT hr = InternalHasSubMenu(uItem, index, dwData);
+ if (hr != S_OK)
+ return hr;
return InternalPopupItem(uItem, index, dwData);
-}
-
-HRESULT CMenuToolbarBase::HasSubMenu(INT uItem)
-{
- INT index;
- DWORD_PTR dwData;
-
- GetDataFromId(uItem, &index, &dwData);
-
- return InternalHasSubMenu(uItem, index, dwData);
}
CMenuStaticToolbar::CMenuStaticToolbar(CMenuBand *menuBand) :
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] Thu Mar 20
15:39:25 2014
@@ -22,8 +22,8 @@
class CMenuBand;
class CMenuFocusManager;
-#define WM_USER_ISTRACKEDITEM (WM_USER+41)
-#define WM_USER_CHANGETRACKEDITEM (WM_USER+42)
+#define WM_USER_ISTRACKEDITEM (WM_APP+41)
+#define WM_USER_CHANGETRACKEDITEM (WM_APP+42)
class CMenuToolbarBase
@@ -89,7 +89,6 @@
virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0;
HRESULT PopupItem(INT uItem);
- HRESULT HasSubMenu(INT uItem);
HRESULT GetDataFromId(INT uItem, INT* pIndex, DWORD_PTR* pData);
protected: