Author: dquintana
Date: Fri May 30 18:00:31 2014
New Revision: 63504
URL:
http://svn.reactos.org/svn/reactos?rev=63504&view=rev
Log:
[SHELL32]
* The CDefView should not process the backspace key directly. It's already handled by
the accelerators.
[BROWSEUI]
* Allow the docked toolbars to translate accelerators.
* CAddressEditBox: Cancel accelerators without modifiers while focused.
[RSHELL]
* Cancel accelerators while a popup is open, and ignore them otherwise.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/dll/win32/browseui/addressband.cpp
branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
branches/shell-experiments/dll/win32/browseui/toolsband.cpp
branches/shell-experiments/dll/win32/shell32/shlview.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] Fri May 30
18:00:31 2014
@@ -1095,14 +1095,15 @@
HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
{
- UNIMPLEMENTED;
- return S_OK;
+ if (m_popupBar)
+ return S_OK;
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
{
- UNIMPLEMENTED;
- return S_OK;
+ // TODO: Alt down -> toggle menu focus
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] Fri May 30
18:00:31 2014
@@ -301,7 +301,22 @@
HRESULT STDMETHODCALLTYPE CAddressBand::TranslateAcceleratorIO(LPMSG lpMsg)
{
- // incomplete
+ if (lpMsg->hwnd == fEditControl)
+ {
+ switch (lpMsg->message)
+ {
+ case WM_SYSKEYDOWN:
+ case WM_SYSKEYUP:
+ case WM_SYSCOMMAND:
+ case WM_SYSDEADCHAR:
+ case WM_SYSCHAR:
+ return S_FALSE;
+ }
+
+ TranslateMessage(lpMsg);
+ DispatchMessage(lpMsg);
+ return S_OK;
+ }
return S_FALSE;
}
@@ -510,6 +525,7 @@
DbgPrint("ERROR %d\n", GetLastError());
}
+ SendMessage(m_hWnd, CB_SETCURSEL, -1, 0);
SendMessage(m_hWnd, CB_SETCURSEL, oldIndex, 0);
//fAddressEditBox->SetCurrentDir(index);
Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Fri May
30 18:00:31 2014
@@ -91,7 +91,6 @@
HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
{
- WCHAR address[4096];
ULONG eaten;
ULONG attributes;
HRESULT hr;
@@ -102,11 +101,34 @@
IUnknown_GetWindow(pisb, &topLevelWindow);
- GetWindowText(fCombobox.m_hWnd, address, 4095);
+ LPWSTR input;
+ int inputLength = GetWindowTextLength(fCombobox.m_hWnd) + 2;
+
+ input = new WCHAR[inputLength];
+ GetWindowText(fCombobox.m_hWnd, input, inputLength);
+
+ LPWSTR address;
+ int addressLength = ExpandEnvironmentStrings(input, NULL, 0);
+
+ if (addressLength <= 0)
+ {
+ address = input;
+ }
+ else
+ {
+ addressLength += 2;
+ address = new WCHAR[addressLength];
+ ExpandEnvironmentStrings(input, address, 0);
+ }
CComPtr<IShellFolder> psfDesktop;
hr = SHGetDesktopFolder(&psfDesktop);
hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten,
&pidlLastParsed, &attributes);
+
+ if (address != input)
+ delete [] address;
+ delete [] input;
+
return hr;
}
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Fri May
30 18:00:31 2014
@@ -72,6 +72,28 @@
extern HRESULT CreateBrandBand(REFIID riid, void **ppv);
extern HRESULT CreateBandProxy(REFIID riid, void **ppv);
extern HRESULT CreateAddressBand(REFIID riid, void **ppv);
+
+HRESULT IUnknown_HasFocusIO(IUnknown * punk)
+{
+ CComPtr<IInputObject> pio;
+ HRESULT hr;
+ hr = punk->QueryInterface(IID_PPV_ARG(IInputObject, &pio));
+ if (FAILED(hr))
+ return hr;
+ return pio->HasFocusIO();
+}
+
+HRESULT IUnknown_TranslateAcceleratorIO(IUnknown * punk, MSG * pmsg)
+{
+ CComPtr<IInputObject> pio;
+ HRESULT hr;
+ if (!punk)
+ return E_FAIL;
+ hr = punk->QueryInterface(IID_PPV_ARG(IInputObject, &pio));
+ if (FAILED(hr))
+ return hr;
+ return pio->TranslateAcceleratorIO(pmsg);
+}
typedef HRESULT(*PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
@@ -740,12 +762,46 @@
HRESULT STDMETHODCALLTYPE CInternetToolbar::HasFocusIO()
{
- return E_NOTIMPL;
+ HRESULT hr = S_FALSE;
+
+ if (fMenuBar)
+ hr = IUnknown_HasFocusIO(fMenuBar);
+ if (hr != S_FALSE)
+ return hr;
+
+ if (fControlsBar)
+ hr = IUnknown_HasFocusIO(fControlsBar);
+ if (hr != S_FALSE)
+ return hr;
+
+ if (fNavigationBar)
+ hr = IUnknown_HasFocusIO(fNavigationBar);
+ if (hr != S_FALSE)
+ return hr;
+
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CInternetToolbar::TranslateAcceleratorIO(LPMSG lpMsg)
{
- return E_NOTIMPL;
+ HRESULT hr = S_FALSE;
+
+ if (fMenuBar)
+ hr = IUnknown_TranslateAcceleratorIO(fMenuBar, lpMsg);
+ if (hr == S_OK)
+ return hr;
+
+ if (fControlsBar)
+ hr = IUnknown_TranslateAcceleratorIO(fControlsBar, lpMsg);
+ if (hr == S_OK)
+ return hr;
+
+ if (fNavigationBar)
+ hr = IUnknown_TranslateAcceleratorIO(fNavigationBar, lpMsg);
+ if (hr == S_OK)
+ return hr;
+
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CInternetToolbar::GetWindow(HWND *lphwnd)
Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Fri May 30
18:00:31 2014
@@ -2539,8 +2539,16 @@
return E_NOTIMPL;
}
+extern HRESULT IUnknown_HasFocusIO(IUnknown * punk);
+extern HRESULT IUnknown_TranslateAcceleratorIO(IUnknown * punk, MSG * pmsg);
HRESULT STDMETHODCALLTYPE CShellBrowser::v_MayTranslateAccelerator(MSG *pmsg)
{
+ for (int i = 0; i < 3; i++)
+ {
+ if (IUnknown_TranslateAcceleratorIO(fClientBars[i].clientBar, pmsg) == S_OK)
+ return S_OK;
+ }
+
if (fCurrentShellView->TranslateAcceleratorW(pmsg) != S_OK)
{
if (TranslateAcceleratorSB(pmsg, 0) != S_OK)
Modified: branches/shell-experiments/dll/win32/browseui/toolsband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] Fri May 30
18:00:31 2014
@@ -386,12 +386,12 @@
HRESULT STDMETHODCALLTYPE CToolsBand::HasFocusIO()
{
- return E_NOTIMPL;
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CToolsBand::TranslateAcceleratorIO(LPMSG lpMsg)
{
- return E_NOTIMPL;
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CToolsBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Fri May 30
18:00:31 2014
@@ -1793,25 +1793,6 @@
return FALSE;
}
- case LVN_KEYDOWN:
- {
- LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh;
-
- /* initiate a rename of the selected file or directory */
- if (plvKeyDown->wVKey == VK_BACK)
- {
- LPSHELLBROWSER lpSb;
- if ((lpSb = (LPSHELLBROWSER)SendMessageW(m_hWndParent,
CWM_GETISHELLBROWSER, 0, 0)))
- {
- lpSb->BrowseObject(NULL, SBSP_PARENT);
- }
- }
-
- else
- FIXME("LVN_KEYDOWN key=0x%08x\n", plvKeyDown->wVKey);
- }
- break;
-
default:
TRACE("-- %p WM_COMMAND %x unhandled\n", this, lpnmh->code);
break;