Author: gedmurphy
Date: Sat Jul 4 21:31:19 2015
New Revision: 68343
URL:
http://svn.reactos.org/svn/reactos?rev=68343&view=rev
Log:
[DEVMGR]
Add the 'add hardware' option for the maun menu or if the root node is selected
Modified:
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h
trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] Sat Jul 4 21:31:19
2015
@@ -168,7 +168,7 @@
HMENU hContextMenu = CreatePopupMenu();
// Add the actions for this node
- BuildActionMenuForNode(hContextMenu, Node);
+ BuildActionMenuForNode(hContextMenu, Node, false);
INT xPos = GET_X_LPARAM(lParam);
INT yPos = GET_Y_LPARAM(lParam);
@@ -279,7 +279,7 @@
CNode *Node = GetSelectedNode();
if (Node)
{
- BuildActionMenuForNode(OwnerMenu, Node);
+ BuildActionMenuForNode(OwnerMenu, Node, MainMenu);
return true;
}
@@ -774,7 +774,8 @@
void
CDeviceView::BuildActionMenuForNode(
_In_ HMENU OwnerMenu,
- _In_ CNode *Node
+ _In_ CNode *Node,
+ _In_ bool MainMenu
)
{
// Create a seperator structure
@@ -842,6 +843,15 @@
MenuItemInfo.dwTypeData = String.GetBuffer();
InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
i++;
+
+ if ((Node->GetNodeType() == RootNode) || (MainMenu == true))
+ {
+ String.LoadStringW(g_hInstance, IDS_MENU_ADD);
+ MenuItemInfo.wID = IDC_ADD_HARDWARE;
+ MenuItemInfo.dwTypeData = String.GetBuffer();
+ InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
+ i++;
+ }
if (Node->HasProperties())
{
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] Sat Jul 4 21:31:19
2015
@@ -134,7 +134,8 @@
void BuildActionMenuForNode(
_In_ HMENU OwnerMenu,
- _In_ CNode *Node
+ _In_ CNode *Node,
+ _In_ bool MainMenu
);
HTREEITEM RecurseFindDevice(
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/M…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/MainWindow.cpp [iso-8859-1] Sat Jul 4 21:31:19
2015
@@ -596,9 +596,9 @@
HMENU hMenu = CreatePopupMenu();
m_DeviceView->CreateActionMenu(hMenu, true);
+ // Calculate where to put the menu
RECT rc;
GetMenuItemRect(m_hMainWnd, m_hMenu, 1, &rc);
-
LONG Height = rc.bottom - rc.top;
// Display the menu