Author: dquintana
Date: Mon May 26 12:26:47 2014
New Revision: 63461
URL:
http://svn.reactos.org/svn/reactos?rev=63461&view=rev
Log:
[RSHELL]
* Close menu on right click too.
[BROWSEUI]
* Check/uncheck the lock toolbar item based on the lock state. The view menu does not
update yet.
[SHELL32]
* Destroy the menu when the view window is destroyed.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.h
branches/shell-experiments/dll/win32/browseui/toolsband.cpp
branches/shell-experiments/dll/win32/shell32/shlview.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Mon
May 26 12:26:47 2014
@@ -378,6 +378,8 @@
{
case WM_NCLBUTTONDOWN:
case WM_LBUTTONDOWN:
+ case WM_NCRBUTTONDOWN:
+ case WM_RBUTTONDOWN:
if (m_menuBar)
{
POINT pt = msg->pt;
@@ -445,6 +447,8 @@
{
case WM_NCLBUTTONDOWN:
case WM_LBUTTONDOWN:
+ case WM_NCRBUTTONDOWN:
+ case WM_RBUTTONDOWN:
if (m_current->type == MenuPopupEntry)
{
HWND child = WindowFromPoint(pt);
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] Mon May
26 12:26:47 2014
@@ -158,14 +158,14 @@
HRESULT CDockSite::Initialize(IUnknown *containedBand, CInternetToolbar *browser, HWND
hwnd, int bandID, int flags)
{
- CComPtr<IObjectWithSite> site;
+ CComPtr<IObjectWithSite> child;
CComPtr<IOleWindow> oleWindow;
CComPtr<IDeskBand> deskBand;
TCHAR textBuffer[40];
REBARBANDINFOW bandInfo;
HRESULT hResult;
- hResult = containedBand->QueryInterface(IID_PPV_ARG(IObjectWithSite, &site));
+ hResult = containedBand->QueryInterface(IID_PPV_ARG(IObjectWithSite,
&child));
if (FAILED(hResult))
return hResult;
hResult = containedBand->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
@@ -179,7 +179,7 @@
fRebarWindow = hwnd;
fBandID = bandID;
fFlags = flags;
- hResult = site->SetSite(static_cast<IOleWindow *>(this));
+ hResult = child->SetSite(static_cast<IOleWindow *>(this));
if (FAILED(hResult))
return hResult;
hResult = oleWindow->GetWindow(&fChildWindow);
@@ -680,6 +680,8 @@
}
}
hResult = ReserveBorderSpace();
+
+ // TODO: refresh view menu?
}
return S_OK;
}
@@ -700,11 +702,11 @@
break;
case 1:
// forward
- hResult = SetState(&CLSID_CommonButtons, gForwardCommandID, newValue ?
TBSTATE_ENABLED : 0);
+ hResult = SetState(&CLSID_CommonButtons, IDM_GOTO_FORWARD, newValue ?
TBSTATE_ENABLED : 0);
break;
case 2:
// back
- hResult = SetState(&CLSID_CommonButtons, gBackCommandID, newValue ?
TBSTATE_ENABLED : 0);
+ hResult = SetState(&CLSID_CommonButtons, IDM_GOTO_BACK, newValue ?
TBSTATE_ENABLED : 0);
break;
}
return hResult;
@@ -1398,7 +1400,7 @@
::MapWindowPoints(fToolbarWindow, NULL, reinterpret_cast<POINT *>(&bounds),
2);
switch (notifyInfo->iItem)
{
- case gBackCommandID:
+ case IDM_GOTO_BACK:
newMenu = CreatePopupMenu();
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider,
&serviceProvider));
hResult = serviceProvider->QueryService(
@@ -1428,7 +1430,7 @@
hResult = travelLog->Travel(browserService, -selectedItem);
DestroyMenu(newMenu);
break;
- case gForwardCommandID:
+ case IDM_GOTO_FORWARD:
newMenu = CreatePopupMenu();
hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider,
&serviceProvider));
hResult = serviceProvider->QueryService(SID_SShellBrowser,
IID_PPV_ARG(IBrowserService, &browserService));
@@ -1529,6 +1531,13 @@
default:
break;
}
+
+ MENUITEMINFO mii;
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_STATE;
+ mii.fState = fLocked ? MFS_CHECKED : MFS_UNCHECKED;
+ command = SetMenuItemInfo(contextMenu, IDM_TOOLBARS_LOCKTOOLBARS, FALSE, &mii);
+
// TODO: use GetSystemMetrics(SM_MENUDROPALIGNMENT) to determine menu alignment
command = TrackPopupMenu(contextMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RIGHTBUTTON
| TPM_RETURNCMD,
clickLocation.x, clickLocation.y, 0, m_hWnd, NULL);
@@ -1588,13 +1597,13 @@
if (nID != 0)
{
- if (nID == (UINT)gBackCommandID || nID == (UINT)gForwardCommandID)
+ if (nID == (UINT)IDM_GOTO_BACK || nID == (UINT)IDM_GOTO_FORWARD)
{
// TODO: Should this call QueryService?
hResult = fSite->QueryInterface(IID_PPV_ARG(IBrowserService,
&browserService));
hResult = browserService->GetTravelLog(&travelLog);
hResult = travelLog->GetToolTipText(browserService,
- (nID == (UINT)gBackCommandID) ? TLOG_BACK : TLOG_FORE,
+ (nID == (UINT)IDM_GOTO_BACK) ? TLOG_BACK : TLOG_FORE,
0, tempString, 299);
if (FAILED(hResult))
{
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1] Mon May
26 12:26:47 2014
@@ -20,9 +20,6 @@
#pragma once
-static const int gBackCommandID = 0xa121;
-static const int gForwardCommandID = 0xa122;
-static const int gUpLevelCommandID = 0xa022;
static const int gSearchCommandID = 1003;
static const int gFoldersCommandID = 1004;
static const int gMoveToCommandID = 0x701f;
@@ -31,10 +28,7 @@
static const int gUndoCommandID = 0x701b;
static const int gViewsCommandID = 0x7031;
static const int gStopCommandID = 1010;
-static const int gRefreshCommandID = 0xa220;
static const int gHomeCommandID = 1012;
-static const int gMapDriveCommandID = 41089;
-static const int gDisconnectCommandID = 41090;
static const int gFavoritesCommandID = 1015;
static const int gHistoryCommandID = 1016;
static const int gFullScreenCommandID = 1017;
@@ -42,7 +36,6 @@
static const int gCutCommandID = 0x7018;
static const int gCopyCommandID = 0x7019;
static const int gPasteCommandID = 0x701a;
-static const int gFolderOptionsCommandID = 41251;
class CMenuCallback :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
@@ -206,9 +199,9 @@
LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
BEGIN_MSG_MAP(CInternetToolbar)
- COMMAND_ID_HANDLER(gBackCommandID, OnTravelBack)
- COMMAND_ID_HANDLER(gForwardCommandID, OnTravelForward)
- COMMAND_ID_HANDLER(gUpLevelCommandID, OnUpLevel)
+ COMMAND_ID_HANDLER(IDM_GOTO_BACK, OnTravelBack)
+ COMMAND_ID_HANDLER(IDM_GOTO_FORWARD, OnTravelForward)
+ COMMAND_ID_HANDLER(IDM_GOTO_UPONELEVEL, OnUpLevel)
COMMAND_ID_HANDLER(gSearchCommandID, OnSearch)
COMMAND_ID_HANDLER(gFoldersCommandID, OnFolders)
COMMAND_RANGE_HANDLER(0x7000, 0x7fff, OnForwardToCommandTarget)
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] Mon May 26
12:26:47 2014
@@ -232,9 +232,9 @@
const int numHiddenButtons = 13;
TBBUTTON tbButtonsAdd[numShownButtons + numHiddenButtons] =
{
- { backImageIndex, gBackCommandID, TBSTATE_ENABLED, BTNS_DROPDOWN | BTNS_SHOWTEXT, { 0
}, 0, BtnIdx_Back },
- { forwardImageIndex, gForwardCommandID, TBSTATE_ENABLED, BTNS_DROPDOWN, { 0 }, 0,
BtnIdx_Forward },
- { upImageIndex, gUpLevelCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0,
BtnIdx_Up },
+ { backImageIndex, IDM_GOTO_BACK, TBSTATE_ENABLED, BTNS_DROPDOWN | BTNS_SHOWTEXT, { 0
}, 0, BtnIdx_Back },
+ { forwardImageIndex, IDM_GOTO_FORWARD, TBSTATE_ENABLED, BTNS_DROPDOWN, { 0 }, 0,
BtnIdx_Forward },
+ { upImageIndex, IDM_GOTO_UPONELEVEL, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0,
BtnIdx_Up },
{ 6, -1, TBSTATE_ENABLED, BTNS_SEP },
{ searchImageIndex, gSearchCommandID, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_SHOWTEXT, {
0 }, 0, BtnIdx_Search },
{ foldersImageIndex, gFoldersCommandID, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_SHOWTEXT,
{ 0 }, 0, BtnIdx_Folders },
@@ -247,10 +247,10 @@
{ viewsImageIndex, gViewsCommandID, TBSTATE_ENABLED, BTNS_WHOLEDROPDOWN, { 0 }, 0,
BtnIdx_Views },
{ 0, gStopCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Stop },
- { 0, gRefreshCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Refresh },
+ { 0, IDM_VIEW_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Refresh },
{ 0, gHomeCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Home },
- { mapDriveImageIndex, gMapDriveCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0,
BtnIdx_MapDrive },
- { disconnectImageIndex, gDisconnectCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0,
BtnIdx_Disconnect },
+ { mapDriveImageIndex, IDM_TOOLS_MAPNETWORKDRIVE, TBSTATE_ENABLED, BTNS_BUTTON, { 0 },
0, BtnIdx_MapDrive },
+ { disconnectImageIndex, IDM_TOOLS_DISCONNECTNETWORKDRIVE, TBSTATE_ENABLED,
BTNS_BUTTON, { 0 }, 0, BtnIdx_Disconnect },
{ favoritesImageIndex, gFavoritesCommandID, TBSTATE_ENABLED, BTNS_BUTTON |
BTNS_SHOWTEXT, { 0 }, 0, BtnIdx_Favorites },
{ 0, gHistoryCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_History },
{ 0, gFullScreenCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_FullScreen
},
@@ -258,11 +258,10 @@
{ cutImageIndex, gCutCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Cut
},
{ copyImageIndex, gCopyCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, BtnIdx_Copy
},
{ pasteImageIndex, gPasteCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0,
BtnIdx_Paste },
- { folderOptionsImageIndex, gFolderOptionsCommandID, TBSTATE_ENABLED, BTNS_BUTTON, { 0
}, 0, BtnIdx_FolderOptions },
+ { folderOptionsImageIndex, IDM_TOOLS_FOLDEROPTIONS, TBSTATE_ENABLED, BTNS_BUTTON, { 0
}, 0, BtnIdx_FolderOptions },
};
-HRESULT STDMETHODCALLTYPE CToolsBand::SetSite(IUnknown* pUnkSite)
-{
+HRESULT STDMETHODCALLTYPE CToolsBand::SetSite(IUnknown* pUnkSite){
HWND parentWindow;
IOleWindow *oleWindow;
HWND toolbar;
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] Mon May 26
12:26:47 2014
@@ -922,6 +922,8 @@
LRESULT CDefView::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
{
+ if (m_hMenu)
+ DestroyMenu(m_hMenu);
RevokeDragDrop(m_hWnd);
SHChangeNotifyDeregister(m_hNotify);
bHandled = FALSE;