Author: dquintana Date: Sun Mar 16 09:28:51 2014 New Revision: 62514
URL: http://svn.reactos.org/svn/reactos?rev=62514&view=rev Log: [RSHELL] * Fix the hot tracking on the filebrowser menubar. Still does not handle switching menus while hovering, though. 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/CMenuToolbars.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Sun Mar 16 09:28:51 2014 @@ -61,7 +61,8 @@ m_useBigIcons(FALSE), m_topLevelWindow(NULL), m_hotBar(NULL), - m_hotItem(-1) + m_hotItem(-1), + m_trackingPopup(FALSE) { m_focusManager = CMenuFocusManager::AcquireManager(); } @@ -513,7 +514,13 @@ m_subMenuChild = NULL; if (!punkClient) return S_OK; - return punkClient->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_subMenuChild)); + HRESULT hr = punkClient->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_subMenuChild)); + m_trackingPopup = m_subMenuChild != NULL; + if (!m_trackingPopup) + { + if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(NULL, -1); + if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(NULL, -1); + } }
HRESULT STDMETHODCALLTYPE CMenuBand::GetClient(IUnknown **ppunkClient) @@ -671,6 +678,7 @@
UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
+ m_trackingPopup = TRUE; if (m_menuOwner) { ::TrackPopupMenuEx(popup, flags, x, y, m_menuOwner, ¶ms); @@ -679,6 +687,7 @@ { ::TrackPopupMenuEx(popup, flags, x, y, m_topLevelWindow, ¶ms); } + m_trackingPopup = FALSE;
return S_OK; } @@ -691,7 +700,7 @@
HRESULT CMenuBand::_OnHotItemChanged(CMenuToolbarBase * tb, INT id) { - if (m_subMenuChild && id == -1) + if (m_trackingPopup && id == -1) { return S_FALSE; } @@ -801,6 +810,7 @@ } if (m_staticToolbar) m_staticToolbar->OnPopupItemChanged(toolbar, item); if (m_SFToolbar) m_SFToolbar->OnPopupItemChanged(toolbar, item); + m_trackingPopup = popup != NULL; if (popup) { if (m_subMenuParent)
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Sun Mar 16 09:28:51 2014 @@ -60,6 +60,7 @@
CMenuToolbarBase * m_hotBar; INT m_hotItem; + BOOL m_trackingPopup;
public: CMenuBand();
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Sun Mar 16 09:28:51 2014 @@ -105,7 +105,7 @@ *pItem = NULL;
if (m_bandCount <= 0) - return E_FAIL; + return S_FALSE;
*pItem = m_bandStack[m_bandCount - 1];
@@ -115,10 +115,10 @@ CMenuFocusManager::CMenuFocusManager() : m_currentBand(NULL), m_currentFocus(NULL), - m_bandCount(0), m_mouseTrackDisabled(FALSE), m_lastMoveFlags(0), - m_lastMovePos(0) + m_lastMovePos(0), + m_bandCount(0) { m_threadId = GetCurrentThreadId(); } @@ -318,6 +318,8 @@
if (newBand == NULL) { + DisableMouseTrack(NULL, FALSE); + hr = RemoveHooks(m_currentFocus); m_currentFocus = NULL; m_currentBand = NULL;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Sun Mar 16 09:28:51 2014 @@ -472,7 +472,10 @@ if (m_hotBar == this && !(m_toolbarFlags & SMINIT_VERTICAL)) { wasChecked = SendMessage(m_hwndToolbar, TB_ISBUTTONCHECKED, m_hotItem, 0); - SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_hotItem, FALSE); + if (wasChecked) + { + SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_hotItem, FALSE); + } } m_hotBar = toolbar; m_hotItem = item; @@ -486,6 +489,10 @@
HRESULT CMenuToolbarBase::OnPopupItemChanged(CMenuToolbarBase * toolbar, INT item) { + if (toolbar == NULL && m_popupBar == this) + { + SendMessage(m_hwndToolbar, TB_CHECKBUTTON, item, FALSE); + } m_popupBar = toolbar; m_popupItem = item; InvalidateDraw();