Add grid menu to routing context menu

This is a missing GAL feature (though grid cycling by hotkey was already
working fine).

Fixes: lp:1519973
* https://bugs.launchpad.net/kicad/+bug/1519973
This commit is contained in:
John Beard 2017-01-09 21:59:30 +08:00 committed by Maciej Suminski
parent c2fb3368f3
commit 3448698849
1 changed files with 7 additions and 2 deletions

View File

@ -49,6 +49,7 @@ using namespace std::placeholders;
#include <tools/size_menu.h> #include <tools/size_menu.h>
#include <tools/selection_tool.h> #include <tools/selection_tool.h>
#include <tools/edit_tool.h> #include <tools/edit_tool.h>
#include <tools/grid_menu.h>
#include <ratsnest_data.h> #include <ratsnest_data.h>
@ -200,7 +201,8 @@ private:
class ROUTER_TOOL_MENU: public CONTEXT_MENU class ROUTER_TOOL_MENU: public CONTEXT_MENU
{ {
public: public:
ROUTER_TOOL_MENU( BOARD* aBoard, PNS::ROUTER_MODE aMode ) ROUTER_TOOL_MENU( BOARD* aBoard, PCB_EDIT_FRAME& frame, PNS::ROUTER_MODE aMode ) :
m_gridMenu( &frame )
{ {
SetTitle( _( "Interactive Router" ) ); SetTitle( _( "Interactive Router" ) );
Add( ACT_NewTrack ); Add( ACT_NewTrack );
@ -224,10 +226,13 @@ public:
AppendSeparator(); AppendSeparator();
Add( PNS::TOOL_BASE::ACT_RouterOptions ); Add( PNS::TOOL_BASE::ACT_RouterOptions );
Add( &m_gridMenu, _( "Grid" ), false );
} }
private: private:
CONTEXT_TRACK_WIDTH_MENU m_widthMenu; CONTEXT_TRACK_WIDTH_MENU m_widthMenu;
GRID_MENU m_gridMenu;
}; };
@ -679,7 +684,7 @@ int ROUTER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
m_startSnapPoint = getViewControls()->GetCursorPosition(); m_startSnapPoint = getViewControls()->GetCursorPosition();
std::unique_ptr<ROUTER_TOOL_MENU> ctxMenu( new ROUTER_TOOL_MENU( board, aMode ) ); std::unique_ptr<ROUTER_TOOL_MENU> ctxMenu( new ROUTER_TOOL_MENU( board, *frame, aMode ) );
SetContextMenu( ctxMenu.get() ); SetContextMenu( ctxMenu.get() );
// Main loop: keep receiving events // Main loop: keep receiving events