Author: dquintana
Date: Mon Feb 24 23:10:12 2014
New Revision: 62323
URL:
http://svn.reactos.org/svn/reactos?rev=62323&view=rev
Log:
[RSHELL]
* CMenuBand: Fix the keyboard navigation a bit. Still not fully working yet.
* Show submenus a bit closer to the arrow, as Windows does.
CORE-7881
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.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/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 24
23:10:12 2014
@@ -314,7 +314,6 @@
return S_OK;
}
-/* IDockingWindow */
HRESULT STDMETHODCALLTYPE CMenuBand::ShowDW(BOOL fShow)
{
HRESULT hr = S_OK;
@@ -392,54 +391,6 @@
}
return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::Load(IStream *pStm)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::Save(IStream *pStm, BOOL fClearDirty)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetSizeMax(ULARGE_INTEGER *pcbSize)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetClassID(CLSID *pClassID)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
OLECMD prgCmds [], OLECMDTEXT *pCmdText)
-{
- UNIMPLEMENTED;
- return S_OK;
}
HRESULT STDMETHODCALLTYPE CMenuBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD
nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
@@ -492,10 +443,6 @@
m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_SELECTRIGHT:
- if (m_hotBar && m_hotItem >= 0)
- {
- // TODO: popup the current child if it has subitems, otherwise spread up.
- }
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_EXECUTE:
case MPOS_FULLCANCEL:
@@ -741,8 +688,7 @@
rc = cdraw->nmcd.rc;
hdc = cdraw->nmcd.hdc;
- if (cdraw->nmcd.uItemState != CDIS_DISABLED &&
- ((INT)cdraw->nmcd.dwItemSpec == m_hotItem ||
+ if (((INT)cdraw->nmcd.dwItemSpec == m_hotItem ||
(m_hotItem < 0 && (INT)cdraw->nmcd.dwItemSpec ==
m_popupItem)))
{
cdraw->nmcd.uItemState = CDIS_HOT;
@@ -799,78 +745,6 @@
return S_FALSE;
}
-HRESULT STDMETHODCALLTYPE CMenuBand::GetSubMenu(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetToolbar(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetMinWidth(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetNoBorder(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetTheme(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetTop(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetBottom(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetTracked(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetParentSite(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetState(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::DoDefaultAction(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::IsEmpty(THIS)
-{
- UNIMPLEMENTED;
- return S_OK;
-}
-
HRESULT CMenuBand::_CallCBWithItemId(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return _CallCB(uMsg, wParam, lParam, id);
@@ -968,7 +842,7 @@
{
if (m_staticToolbar && (m_hotBar == m_staticToolbar || m_hotBar ==
NULL))
{
- hr = m_staticToolbar->ChangeHotItem(VK_DOWN);
+ hr = m_staticToolbar->ChangeHotItem(VK_UP);
if (hr == S_FALSE)
{
if (m_SFToolbar)
@@ -991,9 +865,29 @@
return hr;
}
}
+ else if (changeType == MPOS_SELECTLEFT)
+ {
+ if (m_subMenuChild)
+ m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
+ return m_subMenuParent->OnSelect(MPOS_CANCELLEVEL);
+ }
+ else if (changeType == MPOS_SELECTRIGHT)
+ {
+ if (m_hotBar && m_hotItem >= 0)
+ {
+ // TODO: popup the current child if it has subitems, otherwise spread up.
+ if (m_hotBar->HasSubMenu(m_hotItem)==S_OK)
+ {
+ LRESULT result;
+ m_hotBar->PopupItem(m_hotItem);
+ return S_FALSE;
+ }
+ }
+ return m_subMenuParent->OnSelect(changeType);
+ }
else
{
- m_subMenuParent->OnSelect(changeType);
+ return m_subMenuParent->OnSelect(changeType);
}
return S_OK;
}
@@ -1017,3 +911,123 @@
if (m_SFToolbar) m_SFToolbar->InvalidateDraw();
return S_OK;
}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetSubMenu(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::SetToolbar(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::SetMinWidth(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::SetNoBorder(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::SetTheme(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetTop(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetBottom(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetTracked(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetParentSite(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetState(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::DoDefaultAction(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::IsEmpty(THIS)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::Load(IStream *pStm)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::Save(IStream *pStm, BOOL fClearDirty)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetSizeMax(ULARGE_INTEGER *pcbSize)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::GetClassID(CLSID *pClassID)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
OLECMD prgCmds[], OLECMDTEXT *pCmdText)
+{
+ UNIMPLEMENTED;
+ return S_OK;
+}
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Feb 24
23:10:12 2014
@@ -295,7 +295,7 @@
ClientToScreen(m_hwndToolbar, &a);
ClientToScreen(m_hwndToolbar, &b);
- POINTL pt = { b.x, a.y };
+ POINTL pt = { b.x - 4, a.y };
RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar?