mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 19:33:23 +00:00
[DEVMGR]
Add the 'add hardware' option for the maun menu or if the root node is selected svn path=/trunk/; revision=68343
This commit is contained in:
parent
b5e1b529b3
commit
8fdb754153
3 changed files with 16 additions and 5 deletions
|
@ -168,7 +168,7 @@ CDeviceView::OnContextMenu(
|
|||
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 @@ CDeviceView::CreateActionMenu(
|
|||
CNode *Node = GetSelectedNode();
|
||||
if (Node)
|
||||
{
|
||||
BuildActionMenuForNode(OwnerMenu, Node);
|
||||
BuildActionMenuForNode(OwnerMenu, Node, MainMenu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,8 @@ CDeviceView::InsertIntoTreeView(
|
|||
void
|
||||
CDeviceView::BuildActionMenuForNode(
|
||||
_In_ HMENU OwnerMenu,
|
||||
_In_ CNode *Node
|
||||
_In_ CNode *Node,
|
||||
_In_ bool MainMenu
|
||||
)
|
||||
{
|
||||
// Create a seperator structure
|
||||
|
@ -843,6 +844,15 @@ CDeviceView::BuildActionMenuForNode(
|
|||
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())
|
||||
{
|
||||
InsertMenuItemW(OwnerMenu, i, TRUE, &MenuSeperator);
|
||||
|
|
|
@ -134,7 +134,8 @@ private:
|
|||
|
||||
void BuildActionMenuForNode(
|
||||
_In_ HMENU OwnerMenu,
|
||||
_In_ CNode *Node
|
||||
_In_ CNode *Node,
|
||||
_In_ bool MainMenu
|
||||
);
|
||||
|
||||
HTREEITEM RecurseFindDevice(
|
||||
|
|
|
@ -596,9 +596,9 @@ CMainWindow::OnCommand(WPARAM wParam,
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue