Access tools' TOOL_MENUs rather than CONDITIONAL_MENUs

This means that non-top-level tools, for example EDIT_TOOL and
PCB_EDITOR_CONTROL can submit their own menus to the top-level tool's
TOOL_MENU, which will then retain a reference to it and make it
available for the CONTEXT_MENU that is shown.
This commit is contained in:
John Beard
2017-01-12 18:07:52 +08:00
committed by Maciej Suminski
parent d7db84e282
commit c50d28d94d
8 changed files with 36 additions and 30 deletions
+5 -4
View File
@@ -211,10 +211,11 @@ bool POINT_EDITOR::Init()
return false;
}
m_selectionTool->GetMenu().AddItem( COMMON_ACTIONS::pointEditorAddCorner,
POINT_EDITOR::addCornerCondition );
m_selectionTool->GetMenu().AddItem( COMMON_ACTIONS::pointEditorRemoveCorner,
std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) );
auto& menu = m_selectionTool->GetToolMenu().GetMenu();
menu.AddItem( COMMON_ACTIONS::pointEditorAddCorner,
POINT_EDITOR::addCornerCondition );
menu.AddItem( COMMON_ACTIONS::pointEditorRemoveCorner,
std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) );
return true;
}