From 2060d63e3f57ea71bf44d7929cc471f42d686ee6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 22 May 2018 14:51:30 +0100 Subject: [PATCH] Add context menu for footprint viewing to CvPcb. Fixes: lp:594102 * https://bugs.launchpad.net/kicad/+bug/594102 (cherry picked from commit 800bb8e) --- cvpcb/cvpcb_mainframe.cpp | 12 ++++++++++++ cvpcb/cvpcb_mainframe.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 87932421e6..3041f1dce8 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -214,6 +214,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : // Connect Events 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 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(); } @@ -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 ) { if( m_skipComponentSelect ) diff --git a/cvpcb/cvpcb_mainframe.h b/cvpcb/cvpcb_mainframe.h index 5d0deeb521..232952743b 100644 --- a/cvpcb/cvpcb_mainframe.h +++ b/cvpcb/cvpcb_mainframe.h @@ -146,6 +146,8 @@ public: void DisplayModule( wxCommandEvent& event ); + void OnFootprintRightClick( wxMouseEvent& event ); + /** * Called by the automatic association button * Read *.equ files to try to find corresponding footprint