Add context menu for footprint viewing to CvPcb.

Fixes: lp:594102
* https://bugs.launchpad.net/kicad/+bug/594102

(cherry picked from commit 800bb8e)
This commit is contained in:
Jeff Young 2018-05-22 14:51:30 +01:00
parent 7841f8a466
commit 2060d63e3f
2 changed files with 14 additions and 0 deletions

View File

@ -214,6 +214,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Connect Events // Connect Events
m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this ); m_saveAndContinue->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
m_footprintListBox->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
} }
@ -221,6 +222,7 @@ CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
{ {
// Disconnect Events // Disconnect Events
m_saveAndContinue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this ); m_saveAndContinue->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CVPCB_MAINFRAME::OnSaveAndContinue ), NULL, this );
m_footprintListBox->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( CVPCB_MAINFRAME::OnFootprintRightClick ), NULL, this );
m_auimgr.UnInit(); m_auimgr.UnInit();
} }
@ -506,6 +508,16 @@ void CVPCB_MAINFRAME::DisplayModule( wxCommandEvent& event )
} }
void CVPCB_MAINFRAME::OnFootprintRightClick( wxMouseEvent& event )
{
wxMenu menu;
menu.Append( ID_CVPCB_CREATE_SCREENCMP, _( "View Footprint" ), _( "Show the current footprint in the footprint viewer" ) );
PopupMenu( &menu );
}
void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event ) void CVPCB_MAINFRAME::OnSelectComponent( wxListEvent& event )
{ {
if( m_skipComponentSelect ) if( m_skipComponentSelect )

View File

@ -146,6 +146,8 @@ public:
void DisplayModule( wxCommandEvent& event ); void DisplayModule( wxCommandEvent& event );
void OnFootprintRightClick( wxMouseEvent& event );
/** /**
* Called by the automatic association button * Called by the automatic association button
* Read *.equ files to try to find corresponding footprint * Read *.equ files to try to find corresponding footprint