diff --git a/pcbnew/dialogs/dialog_push_pad_properties.cpp b/pcbnew/dialogs/dialog_push_pad_properties.cpp index 83171ded03..58273cc8fc 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_push_pad_properties.cpp @@ -32,6 +32,7 @@ bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Shape_Filter = true; bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Layer_Filter = true; bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Orient_Filter = true; +bool DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Type_Filter = true; DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES( PCB_BASE_FRAME* aParent ) : @@ -42,6 +43,7 @@ DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES( PCB_BASE_FRAME* aParent m_Pad_Shape_Filter_CB->SetValue( m_Pad_Shape_Filter ); m_Pad_Layer_Filter_CB->SetValue( m_Pad_Layer_Filter ); m_Pad_Orient_Filter_CB->SetValue( m_Pad_Orient_Filter ); + m_Pad_Type_Filter_CB->SetValue( m_Pad_Type_Filter ); // We use a sdbSizer to get platform-dependent ordering of the action buttons, but // that requires us to correct the button labels here. @@ -77,6 +79,7 @@ void DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) m_Pad_Shape_Filter = m_Pad_Shape_Filter_CB->GetValue(); m_Pad_Layer_Filter = m_Pad_Layer_Filter_CB->GetValue(); m_Pad_Orient_Filter = m_Pad_Orient_Filter_CB->GetValue(); + m_Pad_Type_Filter = m_Pad_Type_Filter_CB->GetValue(); EndModal( returncode ); break; } diff --git a/pcbnew/dialogs/dialog_push_pad_properties.h b/pcbnew/dialogs/dialog_push_pad_properties.h index ed1f4d3a50..7efb8d5db0 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties.h +++ b/pcbnew/dialogs/dialog_push_pad_properties.h @@ -41,6 +41,7 @@ public: static bool m_Pad_Shape_Filter; static bool m_Pad_Layer_Filter; static bool m_Pad_Orient_Filter; + static bool m_Pad_Type_Filter; public: DIALOG_PUSH_PAD_PROPERTIES( PCB_BASE_FRAME* aParent ); diff --git a/pcbnew/dialogs/dialog_push_pad_properties_base.cpp b/pcbnew/dialogs/dialog_push_pad_properties_base.cpp index a03ec18764..68b483b793 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_push_pad_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -12,31 +12,34 @@ DIALOG_PUSH_PAD_PROPERTIES_BASE::DIALOG_PUSH_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - + wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - + wxBoxSizer* bLeftSizer; bLeftSizer = new wxBoxSizer( wxVERTICAL ); - + wxStaticBoxSizer* sbSizer1; sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - + m_Pad_Shape_Filter_CB = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - + m_Pad_Layer_Filter_CB = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 ); - + sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_Pad_Orient_Filter_CB = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 ); - - + sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_Pad_Type_Filter_CB = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Do not modify pads having a different type"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer1->Add( m_Pad_Type_Filter_CB, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bLeftSizer->Add( sbSizer1, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - + + bMainSizer->Add( bLeftSizer, 1, wxALL|wxEXPAND, 5 ); - + m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK ); @@ -45,14 +48,14 @@ DIALOG_PUSH_PAD_PROPERTIES_BASE::DIALOG_PUSH_PAD_PROPERTIES_BASE( wxWindow* pare m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - + bMainSizer->Add( m_sdbSizer1, 0, wxALL|wxEXPAND, 5 ); - - + + this->SetSizer( bMainSizer ); this->Layout(); bMainSizer->Fit( this ); - + // Connect Events m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PUSH_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PUSH_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); @@ -63,5 +66,5 @@ DIALOG_PUSH_PAD_PROPERTIES_BASE::~DIALOG_PUSH_PAD_PROPERTIES_BASE() // Disconnect Events m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PUSH_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PUSH_PAD_PROPERTIES_BASE::PadPropertiesAccept ), NULL, this ); - + } diff --git a/pcbnew/dialogs/dialog_push_pad_properties_base.fbp b/pcbnew/dialogs/dialog_push_pad_properties_base.fbp index ff8067fd17..3db721953e 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_push_pad_properties_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -14,6 +14,7 @@ dialog_push_pad_properties_base 1000 none + 1 dialog_push_pad_properties @@ -52,42 +53,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer @@ -114,7 +79,6 @@ wxVERTICAL 1 none - 5 wxBOTTOM|wxRIGHT|wxLEFT @@ -177,35 +141,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -265,35 +205,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -353,30 +269,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Do not modify pads having a different type + + 0 + + + 0 + + 1 + m_Pad_Type_Filter_CB + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + @@ -400,13 +356,7 @@ m_sdbSizer1 protected PadPropertiesAccept - - - - PadPropertiesAccept - - diff --git a/pcbnew/dialogs/dialog_push_pad_properties_base.h b/pcbnew/dialogs/dialog_push_pad_properties_base.h index d40190e69e..bba42d9e66 100644 --- a/pcbnew/dialogs/dialog_push_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_push_pad_properties_base.h @@ -1,12 +1,11 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 30 2017) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#ifndef __DIALOG_PUSH_PAD_PROPERTIES_BASE_H__ -#define __DIALOG_PUSH_PAD_PROPERTIES_BASE_H__ +#pragma once #include #include @@ -32,25 +31,25 @@ class DIALOG_PUSH_PAD_PROPERTIES_BASE : public DIALOG_SHIM { private: - + protected: wxCheckBox* m_Pad_Shape_Filter_CB; wxCheckBox* m_Pad_Layer_Filter_CB; wxCheckBox* m_Pad_Orient_Filter_CB; + wxCheckBox* m_Pad_Type_Filter_CB; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Apply; wxButton* m_sdbSizer1Cancel; - + // Virtual event handlers, overide them in your derived class virtual void PadPropertiesAccept( wxCommandEvent& event ) { event.Skip(); } - - + + public: - - DIALOG_PUSH_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Push Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + + DIALOG_PUSH_PAD_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Push Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_PUSH_PAD_PROPERTIES_BASE(); - + }; -#endif //__DIALOG_PUSH_PAD_PROPERTIES_BASE_H__ diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 142fa8f6ce..023ca72499 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -136,7 +136,8 @@ static void doPushPadProperties( BOARD& board, const D_PAD& aSrcPad, BOARD_COMMI bool aSameFootprints, bool aPadShapeFilter, bool aPadOrientFilter, - bool aPadLayerFilter ) + bool aPadLayerFilter, + bool aPadTypeFilter ) { const MODULE* moduleRef = aSrcPad.GetParent(); @@ -163,8 +164,15 @@ static void doPushPadProperties( BOARD& board, const D_PAD& aSrcPad, BOARD_COMMI if( aPadLayerFilter && ( pad->GetLayerSet() != aSrcPad.GetLayerSet() ) ) continue; - if( aPadLayerFilter && ( pad->GetLayerSet() != aSrcPad.GetLayerSet() ) ) - continue; + if( aPadTypeFilter && ( pad->GetAttribute() != aSrcPad.GetAttribute() ) ) + continue; + + // Special-case for aperture pads + if( aPadTypeFilter && pad->GetAttribute() == PAD_ATTRIB_CONN ) + { + if( pad->IsAperturePad() != aSrcPad.IsAperturePad() ) + continue; + } commit.Modify( pad ); @@ -206,7 +214,8 @@ int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent ) doPushPadProperties( *getModel(), *srcPad, commit, edit_Same_Modules, DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Shape_Filter, DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Orient_Filter, - DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Layer_Filter ); + DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Layer_Filter, + DIALOG_PUSH_PAD_PROPERTIES::m_Pad_Type_Filter ); commit.Push( _( "Push Pad Settings" ) );