mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
[RSHELL]
* Fix the hot tracking on the filebrowser menubar. Still does not handle switching menus while hovering, though. CORE-7586 svn path=/branches/shell-experiments/; revision=62514
This commit is contained in:
parent
ea3e04f67f
commit
aa699bf2a9
4 changed files with 27 additions and 7 deletions
|
@ -61,7 +61,8 @@ CMenuBand::CMenuBand() :
|
|||
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 @@ HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient)
|
|||
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 @@ HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, R
|
|||
|
||||
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 @@ HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, R
|
|||
{
|
||||
::TrackPopupMenuEx(popup, flags, x, y, m_topLevelWindow, ¶ms);
|
||||
}
|
||||
m_trackingPopup = FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -691,7 +700,7 @@ HRESULT CMenuBand::_GetTopLevelWindow(HWND*topLevel)
|
|||
|
||||
HRESULT CMenuBand::_OnHotItemChanged(CMenuToolbarBase * tb, INT id)
|
||||
{
|
||||
if (m_subMenuChild && id == -1)
|
||||
if (m_trackingPopup && id == -1)
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
|
@ -801,6 +810,7 @@ HRESULT CMenuBand::_OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pEx
|
|||
}
|
||||
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)
|
||||
|
|
|
@ -60,6 +60,7 @@ private:
|
|||
|
||||
CMenuToolbarBase * m_hotBar;
|
||||
INT m_hotItem;
|
||||
BOOL m_trackingPopup;
|
||||
|
||||
public:
|
||||
CMenuBand();
|
||||
|
|
|
@ -105,7 +105,7 @@ HRESULT CMenuFocusManager::PeekArray(CMenuBand ** pItem)
|
|||
*pItem = NULL;
|
||||
|
||||
if (m_bandCount <= 0)
|
||||
return E_FAIL;
|
||||
return S_FALSE;
|
||||
|
||||
*pItem = m_bandStack[m_bandCount - 1];
|
||||
|
||||
|
@ -115,10 +115,10 @@ HRESULT CMenuFocusManager::PeekArray(CMenuBand ** pItem)
|
|||
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 @@ HRESULT CMenuFocusManager::UpdateFocus(CMenuBand * newBand)
|
|||
|
||||
if (newBand == NULL)
|
||||
{
|
||||
DisableMouseTrack(NULL, FALSE);
|
||||
|
||||
hr = RemoveHooks(m_currentFocus);
|
||||
m_currentFocus = NULL;
|
||||
m_currentBand = NULL;
|
||||
|
|
|
@ -472,7 +472,10 @@ HRESULT CMenuToolbarBase::OnHotItemChanged(CMenuToolbarBase * toolbar, INT item)
|
|||
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::OnHotItemChanged(CMenuToolbarBase * toolbar, INT item)
|
|||
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue