mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +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()
|
||||
{
|
||||
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()
|
||||
|
|
|
@ -301,7 +301,22 @@ HRESULT STDMETHODCALLTYPE CAddressBand::HasFocusIO()
|
|||
|
||||
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 @@ HRESULT STDMETHODCALLTYPE CAddressBand::Invoke(DISPID dispIdMember, REFIID riid,
|
|||
DbgPrint("ERROR %d\n", GetLastError());
|
||||
}
|
||||
|
||||
SendMessage(m_hWnd, CB_SETCURSEL, -1, 0);
|
||||
SendMessage(m_hWnd, CB_SETCURSEL, oldIndex, 0);
|
||||
|
||||
//fAddressEditBox->SetCurrentDir(index);
|
||||
|
|
|
@ -91,7 +91,6 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::SetCurrentDir(long paramC)
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
|
||||
{
|
||||
WCHAR address[4096];
|
||||
ULONG eaten;
|
||||
ULONG attributes;
|
||||
HRESULT hr;
|
||||
|
@ -102,11 +101,34 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,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);
|
||||
|
||||
class CInternetToolbar;
|
||||
|
@ -740,12 +762,46 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::UIActivateIO(BOOL fActivate, LPMSG l
|
|||
|
||||
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)
|
||||
|
|
|
@ -2539,8 +2539,16 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::_SetFocus(LPTOOLBARITEM ptbi, HWND hwnd
|
|||
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)
|
||||
|
|
|
@ -386,12 +386,12 @@ HRESULT STDMETHODCALLTYPE CToolsBand::ShowDW(BOOL fShow)
|
|||
|
||||
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)
|
||||
|
|
|
@ -1793,25 +1793,6 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandl
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue