mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[SDK] cicuif.h: Fix CUIFMenu::OnKeyDown (#6408)
Supporting Language Bar... JIRA issue: CORE-19363 Implement CUIFMenu::OnKeyDown method.
This commit is contained in:
parent
76c898ca8e
commit
3ac5de4102
1 changed files with 76 additions and 2 deletions
|
@ -5771,11 +5771,85 @@ CUIFMenu::ModalMouseNotify(UINT uMsg, LONG x, LONG y)
|
||||||
CancelMenu();
|
CancelMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @unimplemented
|
|
||||||
inline STDMETHODIMP_(void)
|
inline STDMETHODIMP_(void)
|
||||||
CUIFMenu::OnKeyDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
CUIFMenu::OnKeyDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
//FIXME
|
CUIFMenuItem *pTargetItem;
|
||||||
|
|
||||||
|
BYTE vKey = (BYTE)wParam;
|
||||||
|
|
||||||
|
switch (vKey)
|
||||||
|
{
|
||||||
|
case VK_ESCAPE:
|
||||||
|
CancelMenu();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case VK_LEFT:
|
||||||
|
if (!m_pVisibleSubMenu)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CancelMenu();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case VK_RIGHT:
|
||||||
|
if (m_pSelectedItem && m_pSelectedItem->m_pSubMenu)
|
||||||
|
{
|
||||||
|
m_pSelectedItem->ShowSubPopup();
|
||||||
|
CUIFMenu *pSubMenu = m_pSelectedItem->m_pSubMenu;
|
||||||
|
pTargetItem = pSubMenu->GetNextItem(NULL);
|
||||||
|
pSubMenu->SetSelectedItem(pTargetItem);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case VK_UP:
|
||||||
|
pTargetItem = GetPrevItem(m_pSelectedItem);
|
||||||
|
SetSelectedItem(pTargetItem);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case VK_DOWN:
|
||||||
|
pTargetItem = GetNextItem(m_pSelectedItem);
|
||||||
|
SetSelectedItem(pTargetItem);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case VK_RETURN:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
if (!(('A' <= vKey && vKey <= 'Z') || ('0' <= vKey && vKey <= '9')))
|
||||||
|
return;
|
||||||
|
|
||||||
|
size_t iItem;
|
||||||
|
for (iItem = 0; iItem < m_MenuItems.size(); ++iItem)
|
||||||
|
{
|
||||||
|
CUIFMenuItem *pItem = m_MenuItems[iItem];
|
||||||
|
if (pItem->m_nMenuItemVKey == vKey)
|
||||||
|
{
|
||||||
|
SetSelectedItem(pItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iItem == m_MenuItems.size())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pSelectedItem && !m_pSelectedItem->m_bMenuItemGrayed)
|
||||||
|
{
|
||||||
|
CUIFMenu *pSubMenu = m_pSelectedItem->m_pSubMenu;
|
||||||
|
if (pSubMenu)
|
||||||
|
{
|
||||||
|
m_pSelectedItem->ShowSubPopup();
|
||||||
|
pTargetItem = pSubMenu->GetNextItem(NULL);
|
||||||
|
pSubMenu->SetSelectedItem(pTargetItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetSelectedId(m_pSelectedItem->m_nMenuItemID);
|
||||||
|
::PostMessage(m_hWnd, WM_NULL, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CUIFMenu::PostKey(BOOL bUp, WPARAM wParam, LPARAM lParam)
|
inline void CUIFMenu::PostKey(BOOL bUp, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
Loading…
Reference in a new issue