mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 02:13:06 +00:00
[RSHELL]
* Improve behaviour when hovering and clicking on the menubar. It's still somewhat glitchy though. CORE-7586 svn path=/branches/shell-experiments/; revision=62539
This commit is contained in:
parent
0216102e0c
commit
d2b33acd15
4 changed files with 38 additions and 4 deletions
|
@ -56,6 +56,9 @@ CMenuBand::CMenuBand() :
|
||||||
m_site(NULL),
|
m_site(NULL),
|
||||||
m_psmc(NULL),
|
m_psmc(NULL),
|
||||||
m_subMenuChild(NULL),
|
m_subMenuChild(NULL),
|
||||||
|
m_subMenuParent(NULL),
|
||||||
|
m_childBand(NULL),
|
||||||
|
m_parentBand(NULL),
|
||||||
m_hmenu(NULL),
|
m_hmenu(NULL),
|
||||||
m_menuOwner(NULL),
|
m_menuOwner(NULL),
|
||||||
m_useBigIcons(FALSE),
|
m_useBigIcons(FALSE),
|
||||||
|
@ -352,6 +355,10 @@ HRESULT STDMETHODCALLTYPE CMenuBand::ShowDW(BOOL fShow)
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
else if (m_parentBand)
|
||||||
|
{
|
||||||
|
m_parentBand->SetClient(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (fShow)
|
if (fShow)
|
||||||
hr = m_focusManager->PushMenu(this);
|
hr = m_focusManager->PushMenu(this);
|
||||||
|
@ -490,6 +497,17 @@ HRESULT CMenuBand::_SetChildBand(CMenuBand * child)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT CMenuBand::_SetParentBand(CMenuBand * parent)
|
||||||
|
{
|
||||||
|
m_parentBand = parent;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CMenuBand::_IsPopup()
|
||||||
|
{
|
||||||
|
return m_subMenuParent ? S_OK : S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient)
|
HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient)
|
||||||
{
|
{
|
||||||
if (m_subMenuChild)
|
if (m_subMenuChild)
|
||||||
|
|
|
@ -48,6 +48,7 @@ private:
|
||||||
CComPtr<IMenuPopup> m_subMenuChild;
|
CComPtr<IMenuPopup> m_subMenuChild;
|
||||||
CComPtr<IMenuPopup> m_subMenuParent;
|
CComPtr<IMenuPopup> m_subMenuParent;
|
||||||
CComPtr<CMenuBand> m_childBand;
|
CComPtr<CMenuBand> m_childBand;
|
||||||
|
CComPtr<CMenuBand> m_parentBand;
|
||||||
|
|
||||||
UINT m_uId;
|
UINT m_uId;
|
||||||
UINT m_uIdAncestor;
|
UINT m_uIdAncestor;
|
||||||
|
@ -180,6 +181,8 @@ public:
|
||||||
HRESULT _OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude, CMenuToolbarBase * toolbar, INT item);
|
HRESULT _OnPopupSubMenu(IMenuPopup * popup, POINTL * pAt, RECTL * pExclude, CMenuToolbarBase * toolbar, INT item);
|
||||||
HRESULT _DisableMouseTrack(BOOL bDisable);
|
HRESULT _DisableMouseTrack(BOOL bDisable);
|
||||||
HRESULT _SetChildBand(CMenuBand * child);
|
HRESULT _SetChildBand(CMenuBand * child);
|
||||||
|
HRESULT _SetParentBand(CMenuBand * parent);
|
||||||
|
HRESULT _IsPopup();
|
||||||
|
|
||||||
BOOL UseBigIcons()
|
BOOL UseBigIcons()
|
||||||
{
|
{
|
||||||
|
|
|
@ -188,7 +188,9 @@ HRESULT CMenuFocusManager::IsTrackedWindow(HWND hWnd)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (hwnd == hWnd)
|
if (hwnd == hWnd)
|
||||||
return S_OK;
|
{
|
||||||
|
return band->_IsPopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
@ -232,10 +234,10 @@ LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg)
|
||||||
if (m_currentMenu)
|
if (m_currentMenu)
|
||||||
SendMessage(m_currentFocus, WM_CANCELMODE, 0, 0);
|
SendMessage(m_currentFocus, WM_CANCELMODE, 0, 0);
|
||||||
else
|
else
|
||||||
m_currentBand->_MenuItemHotTrack(MPOS_SELECTLEFT);
|
m_currentBand->_MenuItemHotTrack(MPOS_CANCELLEVEL);
|
||||||
DbgPrint("Active popup cancelled, notifying of change...\n");
|
DbgPrint("Active popup cancelled, notifying of change...\n");
|
||||||
PostMessage(hwndToolbar, WM_USER_CHANGETRACKEDITEM, iHitTestResult, iHitTestResult);
|
PostMessage(hwndToolbar, WM_USER_CHANGETRACKEDITEM, iHitTestResult, iHitTestResult);
|
||||||
return TRUE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -447,6 +449,7 @@ HRESULT CMenuFocusManager::PushMenu(CMenuBand * mb)
|
||||||
if (mbParent)
|
if (mbParent)
|
||||||
{
|
{
|
||||||
mbParent->_SetChildBand(mb);
|
mbParent->_SetChildBand(mb);
|
||||||
|
mb->_SetParentBand(mbParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return UpdateFocus(mb);
|
return UpdateFocus(mb);
|
||||||
|
@ -457,6 +460,11 @@ HRESULT CMenuFocusManager::PopMenu(CMenuBand * mb)
|
||||||
CMenuBand * mbc;
|
CMenuBand * mbc;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (m_currentBand)
|
||||||
|
{
|
||||||
|
m_currentBand->_SetParentBand(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
HWND newFocus;
|
HWND newFocus;
|
||||||
hr = mb->_GetTopLevelWindow(&newFocus);
|
hr = mb->_GetTopLevelWindow(&newFocus);
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
|
|
@ -1050,6 +1050,12 @@ HRESULT CMenuStaticToolbar::OnContextMenu(NMMOUSE * rclick)
|
||||||
HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult)
|
HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (m_isTracking)
|
||||||
|
{
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
hr = CMenuToolbarBase::OnCommand(wParam, lParam, theResult);
|
hr = CMenuToolbarBase::OnCommand(wParam, lParam, theResult);
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -1057,7 +1063,6 @@ HRESULT CMenuStaticToolbar::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *the
|
||||||
// in case the clicked item has a submenu, we do not need to execute the item
|
// in case the clicked item has a submenu, we do not need to execute the item
|
||||||
if (hr == S_FALSE)
|
if (hr == S_FALSE)
|
||||||
{
|
{
|
||||||
DbgPrint("CMenuToolbarBase::OnCommand told us to cancel.\n");
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue