mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:03:00 +00:00
[RSHELL]
* Fix executing items after the menu has closed. svn path=/branches/shell-experiments/; revision=65074
This commit is contained in:
parent
180b6fb083
commit
30a510975b
3 changed files with 19 additions and 9 deletions
|
@ -948,14 +948,18 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
|
|||
switch (changeType)
|
||||
{
|
||||
case MPOS_EXECUTE:
|
||||
{
|
||||
CMenuToolbarBase * tb = m_hotBar;
|
||||
int item = m_hotItem;
|
||||
tb->PrepareExecuteItem(item);
|
||||
if (m_subMenuParent)
|
||||
{
|
||||
m_subMenuParent->OnSelect(changeType);
|
||||
}
|
||||
TRACE("Menu closed, executing item...\n");
|
||||
m_hotBar->ExecuteItem(m_hotItem);
|
||||
tb->ExecuteItem();
|
||||
break;
|
||||
|
||||
}
|
||||
case MPOS_SELECTLEFT:
|
||||
if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE)
|
||||
return m_parentBand->_MenuItemHotTrack(VK_LEFT);
|
||||
|
|
|
@ -846,16 +846,17 @@ HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex)
|
|||
return ProcessClick(btn.idCommand);
|
||||
}
|
||||
|
||||
HRESULT CMenuToolbarBase::ExecuteItem(INT iItem)
|
||||
HRESULT CMenuToolbarBase::PrepareExecuteItem(INT iItem)
|
||||
{
|
||||
this->m_menuBand->_KillPopupTimers();
|
||||
|
||||
INT index;
|
||||
DWORD_PTR data;
|
||||
m_executeItem = iItem;
|
||||
return GetDataFromId(iItem, &m_executeIndex, &m_executeData);
|
||||
}
|
||||
|
||||
GetDataFromId(iItem, &index, &data);
|
||||
|
||||
return InternalExecuteItem(iItem, index, data);
|
||||
HRESULT CMenuToolbarBase::ExecuteItem()
|
||||
{
|
||||
return InternalExecuteItem(m_executeItem, m_executeItem, m_executeData);
|
||||
}
|
||||
|
||||
HRESULT CMenuToolbarBase::OnContextMenu(NMMOUSE * rclick)
|
||||
|
|
|
@ -51,6 +51,10 @@ protected:
|
|||
DWORD m_initFlags;
|
||||
BOOL m_isTrackingPopup;
|
||||
|
||||
INT m_executeIndex;
|
||||
INT m_executeItem;
|
||||
DWORD_PTR m_executeData;
|
||||
|
||||
private:
|
||||
static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
@ -77,7 +81,8 @@ public:
|
|||
|
||||
HRESULT KeyboardItemChange(DWORD changeType);
|
||||
|
||||
HRESULT ExecuteItem(INT iItem);
|
||||
HRESULT PrepareExecuteItem(INT iItem);
|
||||
HRESULT ExecuteItem();
|
||||
|
||||
HRESULT IsTrackedItem(INT index);
|
||||
HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue