Make sure placement menu has a pointer back to its tool.

Fixes: lp:1831730
* https://bugs.launchpad.net/kicad/+bug/1831730
This commit is contained in:
Jeff Young 2019-06-09 23:32:08 +01:00
parent a568e70b99
commit 1f6a5c92d7
1 changed files with 10 additions and 8 deletions

View File

@ -102,6 +102,7 @@ bool ALIGN_DISTRIBUTE_TOOL::Init()
// Create a context menu and make it available through selection tool
m_placementMenu = new ACTION_MENU;
m_placementMenu->SetTool( this );
m_placementMenu->SetIcon( align_items_xpm );
m_placementMenu->SetTitle( _( "Align/Distribute" ) );
@ -112,6 +113,7 @@ bool ALIGN_DISTRIBUTE_TOOL::Init()
m_placementMenu->Add( PCB_ACTIONS::alignRight );
m_placementMenu->Add( PCB_ACTIONS::alignCenterX );
m_placementMenu->Add( PCB_ACTIONS::alignCenterY );
m_placementMenu->AppendSeparator();
m_placementMenu->Add( PCB_ACTIONS::distributeHorizontally );
m_placementMenu->Add( PCB_ACTIONS::distributeVertically );
@ -639,13 +641,13 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( ALIGNMENT_RECTS& item
void ALIGN_DISTRIBUTE_TOOL::setTransitions()
{
Go( &ALIGN_DISTRIBUTE_TOOL::AlignTop, PCB_ACTIONS::alignTop.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignBottom, PCB_ACTIONS::alignBottom.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignLeft, PCB_ACTIONS::alignLeft.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignRight, PCB_ACTIONS::alignRight.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterX, PCB_ACTIONS::alignCenterX.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterY, PCB_ACTIONS::alignCenterY.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignTop, PCB_ACTIONS::alignTop.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignBottom, PCB_ACTIONS::alignBottom.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignLeft, PCB_ACTIONS::alignLeft.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignRight, PCB_ACTIONS::alignRight.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterX, PCB_ACTIONS::alignCenterX.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::AlignCenterY, PCB_ACTIONS::alignCenterY.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally, PCB_ACTIONS::distributeHorizontally.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeVertically, PCB_ACTIONS::distributeVertically.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally, PCB_ACTIONS::distributeHorizontally.MakeEvent() );
Go( &ALIGN_DISTRIBUTE_TOOL::DistributeVertically, PCB_ACTIONS::distributeVertically.MakeEvent() );
}