mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 17:30:32 +00:00
[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. svn path=/branches/shell-experiments/; revision=63504
This commit is contained in:
parent
acd03fd182
commit
9793ab272f
7 changed files with 114 additions and 30 deletions
|
@ -1095,14 +1095,15 @@ HRESULT STDMETHODCALLTYPE CMenuBand::IsEmpty(THIS)
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
|
HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
if (m_popupBar)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
// TODO: Alt down -> toggle menu focus
|
||||||
return S_OK;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
|
HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
|
||||||
|
|
|
@ -301,7 +301,22 @@ HRESULT STDMETHODCALLTYPE CAddressBand::HasFocusIO()
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CAddressBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
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;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,6 +525,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::Invoke(DISPID dispIdMember, REFIID riid,
|
||||||
DbgPrint("ERROR %d\n", GetLastError());
|
DbgPrint("ERROR %d\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendMessage(m_hWnd, CB_SETCURSEL, -1, 0);
|
||||||
SendMessage(m_hWnd, CB_SETCURSEL, oldIndex, 0);
|
SendMessage(m_hWnd, CB_SETCURSEL, oldIndex, 0);
|
||||||
|
|
||||||
//fAddressEditBox->SetCurrentDir(index);
|
//fAddressEditBox->SetCurrentDir(index);
|
||||||
|
|
|
@ -91,7 +91,6 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::SetCurrentDir(long paramC)
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
|
HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
|
||||||
{
|
{
|
||||||
WCHAR address[4096];
|
|
||||||
ULONG eaten;
|
ULONG eaten;
|
||||||
ULONG attributes;
|
ULONG attributes;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -102,11 +101,34 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
|
||||||
|
|
||||||
IUnknown_GetWindow(pisb, &topLevelWindow);
|
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;
|
CComPtr<IShellFolder> psfDesktop;
|
||||||
hr = SHGetDesktopFolder(&psfDesktop);
|
hr = SHGetDesktopFolder(&psfDesktop);
|
||||||
hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten, &pidlLastParsed, &attributes);
|
hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten, &pidlLastParsed, &attributes);
|
||||||
|
|
||||||
|
if (address != input)
|
||||||
|
delete [] address;
|
||||||
|
delete [] input;
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,28 @@ extern HRESULT CreateBrandBand(REFIID riid, void **ppv);
|
||||||
extern HRESULT CreateBandProxy(REFIID riid, void **ppv);
|
extern HRESULT CreateBandProxy(REFIID riid, void **ppv);
|
||||||
extern HRESULT CreateAddressBand(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);
|
typedef HRESULT(*PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
|
||||||
|
|
||||||
class CInternetToolbar;
|
class CInternetToolbar;
|
||||||
|
@ -740,12 +762,46 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::UIActivateIO(BOOL fActivate, LPMSG l
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CInternetToolbar::HasFocusIO()
|
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)
|
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)
|
HRESULT STDMETHODCALLTYPE CInternetToolbar::GetWindow(HWND *lphwnd)
|
||||||
|
|
|
@ -2539,8 +2539,16 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::_SetFocus(LPTOOLBARITEM ptbi, HWND hwnd
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern HRESULT IUnknown_HasFocusIO(IUnknown * punk);
|
||||||
|
extern HRESULT IUnknown_TranslateAcceleratorIO(IUnknown * punk, MSG * pmsg);
|
||||||
HRESULT STDMETHODCALLTYPE CShellBrowser::v_MayTranslateAccelerator(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 (fCurrentShellView->TranslateAcceleratorW(pmsg) != S_OK)
|
||||||
{
|
{
|
||||||
if (TranslateAcceleratorSB(pmsg, 0) != S_OK)
|
if (TranslateAcceleratorSB(pmsg, 0) != S_OK)
|
||||||
|
|
|
@ -386,12 +386,12 @@ HRESULT STDMETHODCALLTYPE CToolsBand::ShowDW(BOOL fShow)
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CToolsBand::HasFocusIO()
|
HRESULT STDMETHODCALLTYPE CToolsBand::HasFocusIO()
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CToolsBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
HRESULT STDMETHODCALLTYPE CToolsBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CToolsBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
|
HRESULT STDMETHODCALLTYPE CToolsBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
|
||||||
|
|
|
@ -1793,25 +1793,6 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
||||||
return FALSE;
|
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:
|
default:
|
||||||
TRACE("-- %p WM_COMMAND %x unhandled\n", this, lpnmh->code);
|
TRACE("-- %p WM_COMMAND %x unhandled\n", this, lpnmh->code);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue