From 8cbdf5ba12846fafce8e512187dbb6c50dfdf125 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 22 Oct 2021 19:55:06 +0100 Subject: [PATCH] Keep default pad number up-to-date (in both directions). Also hides the net selector when in the footprint editor as it has no meaning there. (We still only grey it out for the board editor when the pad type has no net to keep things from coming and going too much.) Fixes https://gitlab.com/kicad/code/kicad/issues/9317 --- pcbnew/dialogs/dialog_pad_properties.cpp | 116 ++++++++++-------- pcbnew/dialogs/dialog_pad_properties_base.cpp | 46 ++++--- pcbnew/dialogs/dialog_pad_properties_base.fbp | 10 +- pcbnew/dialogs/dialog_pad_properties_base.h | 10 +- pcbnew/tools/pad_tool.cpp | 5 - pcbnew/tools/pad_tool.h | 1 - 6 files changed, 100 insertions(+), 88 deletions(-) diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 040296c50d..79a337e44c 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -106,18 +106,7 @@ void PCB_BASE_FRAME::ShowPadPropertiesDialog( PAD* aPad ) { DIALOG_PAD_PROPERTIES dlg( this, aPad ); - if( dlg.ShowQuasiModal() == wxID_OK ) // QuasiModal required for NET_SELECTOR - { - // aPad can be NULL, if the dialog is called from the footprint editor - // to set the default pad setup - if( aPad ) - { - PAD_TOOL* padTools = m_toolManager->GetTool(); - - if( padTools ) - padTools->SetLastPadNumber( aPad->GetNumber() ); - } - } + dlg.ShowQuasiModal(); } @@ -163,8 +152,8 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad m_posX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD ); m_posY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD ); - m_PadNetSelector->SetBoard( m_board ); - m_PadNetSelector->SetNetInfo( &m_board->GetNetInfo() ); + m_padNetSelector->SetBoard( m_board ); + m_padNetSelector->SetNetInfo( &m_board->GetNetInfo() ); m_OrientValidator.SetRange( -360.0, 360.0 ); m_orientation->SetValidator( m_OrientValidator ); @@ -180,15 +169,24 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad if( aPad ) { + SetTitle( _( "Pad Properties" ) ); + *m_dummyPad = *aPad; m_dummyPad->ClearFlags( SELECTED|BRIGHTENED ); } else { - // We are editing a "master" pad, i.e. a template to create new pads + SetTitle( _( "Default Pad Properties for Add Pad Tool" ) ); + *m_dummyPad = *m_padMaster; } + if( m_isFpEditor ) + { + m_padNetLabel->Show( false ); + m_padNetSelector->Show( false ); + } + // Pad needs to have a parent for painting; use the parent board for its design settings if( !m_dummyPad->GetParent() ) m_dummyPad->SetParent( m_board ); @@ -227,11 +225,11 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad // Initialize canvas to be able to display the dummy pad: prepareCanvas(); - SetInitialFocus( m_PadNumCtrl ); + SetInitialFocus( m_padNumCtrl ); m_sdbSizerOK->SetDefault(); m_canUpdate = true; - m_PadNetSelector->Connect( NET_SELECTED, + m_padNetSelector->Connect( NET_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES::OnValuesChanged ), nullptr, this ); @@ -245,7 +243,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad DIALOG_PAD_PROPERTIES::~DIALOG_PAD_PROPERTIES() { - m_PadNetSelector->Disconnect( NET_SELECTED, + m_padNetSelector->Disconnect( NET_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES::OnValuesChanged ), nullptr, this ); @@ -477,8 +475,6 @@ void DIALOG_PAD_PROPERTIES::initValues() if( m_currentPad ) { - SetTitle( _( "Pad Properties" ) ); - m_locked->SetValue( m_currentPad->IsLocked() ); m_isFlipped = m_currentPad->IsFlipped(); @@ -494,8 +490,7 @@ void DIALOG_PAD_PROPERTIES::initValues() msg.Printf( _("Footprint %s (%s), %s, rotated %g deg"), footprint->Reference().GetShownText(), footprint->Value().GetShownText(), - footprint->IsFlipped() ? _( "back side (mirrored)" ) - : _( "front side" ), + footprint->IsFlipped() ? _( "back side (mirrored)" ) : _( "front side" ), footprint->GetOrientationDegrees() ); } @@ -503,8 +498,6 @@ void DIALOG_PAD_PROPERTIES::initValues() } else { - SetTitle( _( "Default Pad Properties for Add Pad Tool" ) ); - m_locked->Hide(); m_isFlipped = false; } @@ -519,8 +512,17 @@ void DIALOG_PAD_PROPERTIES::initValues() m_FlippedWarningSizer->Show( m_isFlipped ); - m_PadNumCtrl->SetValue( m_dummyPad->GetNumber() ); - m_PadNetSelector->SetSelectedNetcode( m_dummyPad->GetNetCode() ); + if( m_currentPad ) + { + m_padNumCtrl->SetValue( m_dummyPad->GetNumber() ); + } + else + { + PAD_TOOL* padTool = m_parent->GetToolManager()->GetTool(); + m_padNumCtrl->SetValue( padTool->GetLastPadNumber() ); + } + + m_padNetSelector->SetSelectedNetcode( m_dummyPad->GetNetCode() ); // Display current pad parameters units: m_posX.ChangeValue( m_dummyPad->GetPosition().x ); @@ -620,16 +622,16 @@ void DIALOG_PAD_PROPERTIES::initValues() if( aperture ) { - m_PadType->SetSelection( APERTURE_DLG_TYPE ); + m_padType->SetSelection( APERTURE_DLG_TYPE ); } else { switch( m_dummyPad->GetAttribute() ) { - case PAD_ATTRIB::PTH: m_PadType->SetSelection( PTH_DLG_TYPE ); break; - case PAD_ATTRIB::SMD: m_PadType->SetSelection( SMD_DLG_TYPE ); break; - case PAD_ATTRIB::CONN: m_PadType->SetSelection( CONN_DLG_TYPE ); break; - case PAD_ATTRIB::NPTH: m_PadType->SetSelection( NPTH_DLG_TYPE ); break; + case PAD_ATTRIB::PTH: m_padType->SetSelection( PTH_DLG_TYPE ); break; + case PAD_ATTRIB::SMD: m_padType->SetSelection( SMD_DLG_TYPE ); break; + case PAD_ATTRIB::CONN: m_padType->SetSelection( CONN_DLG_TYPE ); break; + case PAD_ATTRIB::NPTH: m_padType->SetSelection( NPTH_DLG_TYPE ); break; } } @@ -914,7 +916,7 @@ void DIALOG_PAD_PROPERTIES::UpdateLayersDropdown() { m_rbCopperLayersSel->Clear(); - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: m_rbCopperLayersSel->Append( _( "All copper layers" ) ); @@ -953,7 +955,7 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) bool hasConnection = true; bool hasProperty = true; - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: hasHole = true; hasConnection = true; hasProperty = true; break; case SMD_DLG_TYPE: hasHole = false; hasConnection = true; hasProperty = true; break; @@ -978,14 +980,14 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) if( !hasConnection ) { - m_PadNumCtrl->ChangeValue( wxEmptyString ); - m_PadNetSelector->SetSelectedNetcode( 0 ); + m_padNumCtrl->ChangeValue( wxEmptyString ); + m_padNetSelector->SetSelectedNetcode( 0 ); m_padToDieOpt->SetValue( false ); } - else if( m_PadNumCtrl->GetValue().IsEmpty() && m_currentPad ) + else if( m_padNumCtrl->GetValue().IsEmpty() && m_currentPad ) { - m_PadNumCtrl->ChangeValue( m_currentPad->GetNumber() ); - m_PadNetSelector->SetSelectedNetcode( m_currentPad->GetNetCode() ); + m_padNumCtrl->ChangeValue( m_currentPad->GetNumber() ); + m_padNetSelector->SetSelectedNetcode( m_currentPad->GetNetCode() ); } if( !hasProperty ) @@ -1008,7 +1010,7 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) bool hasHole = true; bool hasConnection = true; - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: /* PTH */ hasHole = true; hasConnection = true; break; case SMD_DLG_TYPE: /* SMD */ hasHole = false; hasConnection = true; break; @@ -1023,11 +1025,17 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_holeX.Enable( hasHole ); m_holeY.Enable( hasHole && m_holeShapeCtrl->GetSelection() == 1 ); - // Enable/disable Pad number, net and pad length-to-die - m_PadNumText->Enable( hasConnection ); - m_PadNumCtrl->Enable( hasConnection ); - m_PadNameText->Enable( hasConnection ); - m_PadNetSelector->Enable( hasConnection && m_canEditNetName && m_currentPad ); + // Enable/disable number and net + m_padNumLabel->Enable( hasConnection ); + m_padNumCtrl->Enable( hasConnection ); + + if( m_padNetLabel->IsShown() ) + { + m_padNetLabel->Enable( hasConnection && m_canEditNetName && m_currentPad ); + m_padNetSelector->Enable( hasConnection && m_canEditNetName && m_currentPad ); + } + + // Enable/disable pad length-to-die m_padToDieOpt->Enable( hasConnection ); if( !m_padToDieOpt->IsEnabled() ) @@ -1039,11 +1047,11 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) m_padToDie.Show( m_padToDieOpt->GetValue() ); // Enable/disable Copper Layers control - m_rbCopperLayersSel->Enable( m_PadType->GetSelection() != APERTURE_DLG_TYPE ); + m_rbCopperLayersSel->Enable( m_padType->GetSelection() != APERTURE_DLG_TYPE ); LSET cu_set = m_dummyPad->GetLayerSet() & LSET::AllCuMask(); - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: if( !cu_set.any() ) @@ -1090,7 +1098,7 @@ void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_un { UpdateLayersDropdown(); - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: if( !layer_mask.any() ) @@ -1536,6 +1544,9 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() transferDataToPad( m_padMaster ); + PAD_TOOL* padTool = m_parent->GetToolManager()->GetTool(); + padTool->SetLastPadNumber( m_padMaster->GetNumber() ); + // m_padMaster is a pattern: ensure there is no net for this pad: m_padMaster->SetNetCode( NETINFO_LIST::UNCONNECTED ); @@ -1578,7 +1589,6 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() if( m_padMaster->GetShape() != PAD_SHAPE::CUSTOM ) m_padMaster->DeletePrimitivesList(); - m_currentPad->SetAnchorPadShape( m_padMaster->GetAnchorPadShape() ); m_currentPad->ReplacePrimitives( m_padMaster->GetPrimitives() ); @@ -1592,7 +1602,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() // For PAD_ATTRIB::NPTH, ensure there is no net name selected if( m_padMaster->GetAttribute() != PAD_ATTRIB::NPTH ) - padNetcode = m_PadNetSelector->GetSelectedNetcode(); + padNetcode = m_padNetSelector->GetSelectedNetcode(); m_currentPad->SetNetCode( padNetcode ); m_currentPad->SetLocalClearance( m_padMaster->GetLocalClearance() ); @@ -1684,7 +1694,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) m_OrientValidator.TransferFromWindow(); - aPad->SetAttribute( code_type[m_PadType->GetSelection()] ); + aPad->SetAttribute( code_type[m_padType->GetSelection()] ); aPad->SetShape( code_shape[m_PadShapeSelector->GetSelection()] ); if( m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR ) @@ -1782,8 +1792,8 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) aPad->SetPadToDieLength( 0 ); aPad->SetOrientation( m_OrientValue * 10.0 ); - aPad->SetNumber( m_PadNumCtrl->GetValue() ); - aPad->SetNetCode( m_PadNetSelector->GetSelectedNetcode() ); + aPad->SetNumber( m_padNumCtrl->GetValue() ); + aPad->SetNetCode( m_padNetSelector->GetSelectedNetcode() ); int chamfers = 0; @@ -1886,7 +1896,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) aPad->SetRemoveUnconnected( false ); aPad->SetKeepTopBottom( false ); - switch( m_PadType->GetSelection() ) + switch( m_padType->GetSelection() ) { case PTH_DLG_TYPE: switch( copperLayersChoice ) diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index cc5e6d6d3e..7bf1f42180 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -37,25 +37,25 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_padTypeLabel->Wrap( -1 ); gbSizerCommon->Add( m_padTypeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - wxString m_PadTypeChoices[] = { _("Through-hole"), _("SMD"), _("Edge Connector"), _("NPTH, Mechanical"), _("SMD Aperture") }; - int m_PadTypeNChoices = sizeof( m_PadTypeChoices ) / sizeof( wxString ); - m_PadType = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PadTypeNChoices, m_PadTypeChoices, 0 ); - m_PadType->SetSelection( 0 ); - gbSizerCommon->Add( m_PadType, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); + wxString m_padTypeChoices[] = { _("Through-hole"), _("SMD"), _("Edge Connector"), _("NPTH, Mechanical"), _("SMD Aperture") }; + int m_padTypeNChoices = sizeof( m_padTypeChoices ) / sizeof( wxString ); + m_padType = new wxChoice( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_padTypeNChoices, m_padTypeChoices, 0 ); + m_padType->SetSelection( 0 ); + gbSizerCommon->Add( m_padType, wxGBPosition( 0, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); - m_PadNumText = new wxStaticText( m_panelGeneral, wxID_ANY, _("Pad number:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PadNumText->Wrap( -1 ); - gbSizerCommon->Add( m_PadNumText, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + m_padNumLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Pad number:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_padNumLabel->Wrap( -1 ); + gbSizerCommon->Add( m_padNumLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_PadNumCtrl = new wxTextCtrl( m_panelGeneral, wxID_PADNUMCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_PadNumCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + m_padNumCtrl = new wxTextCtrl( m_panelGeneral, wxID_PADNUMCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizerCommon->Add( m_padNumCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 5 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_PadNameText = new wxStaticText( m_panelGeneral, wxID_ANY, _("Net name:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PadNameText->Wrap( -1 ); - gbSizerCommon->Add( m_PadNameText, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + m_padNetLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Net name:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_padNetLabel->Wrap( -1 ); + gbSizerCommon->Add( m_padNetLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_PadNetSelector = new NET_SELECTOR( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizerCommon->Add( m_PadNetSelector, wxGBPosition( 2, 1 ), wxGBSpan( 1, 5 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + m_padNetSelector = new NET_SELECTOR( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + gbSizerCommon->Add( m_padNetSelector, wxGBPosition( 2, 1 ), wxGBSpan( 1, 5 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); m_posXLabel = new wxStaticText( m_panelGeneral, wxID_ANY, _("Position X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_posXLabel->Wrap( -1 ); @@ -593,6 +593,14 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_staticTextInfoNegVal->Wrap( -1 ); sbClearancesSizer->Add( m_staticTextInfoNegVal, 0, wxBOTTOM|wxRIGHT, 10 ); + m_staticTextInfoPosValue = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Positive clearance means area bigger than the pad (usual for mask clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfoPosValue->Wrap( -1 ); + sbClearancesSizer->Add( m_staticTextInfoPosValue, 0, wxTOP|wxRIGHT, 10 ); + + m_staticTextInfoNegVal = new wxStaticText( sbClearancesSizer->GetStaticBox(), wxID_ANY, _("Negative clearance means area smaller than the pad (usual for paste clearance)."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfoNegVal->Wrap( -1 ); + sbClearancesSizer->Add( m_staticTextInfoNegVal, 0, wxBOTTOM|wxRIGHT, 10 ); + wxFlexGridSizer* fgClearancesGridSizer; fgClearancesGridSizer = new wxFlexGridSizer( 4, 3, 0, 0 ); fgClearancesGridSizer->AddGrowableCol( 1 ); @@ -985,8 +993,8 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnInitDialog ) ); m_panelGeneral->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnUpdateUI ), NULL, this ); - m_PadType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); - m_PadNumCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_padType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); + m_padNumCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadShapeSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this ); m_trapDeltaCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_trapAxisCtrl->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); @@ -1045,8 +1053,8 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() // Disconnect Events this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnInitDialog ) ); m_panelGeneral->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnUpdateUI ), NULL, this ); - m_PadType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); - m_PadNumCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); + m_padType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); + m_padNumCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadShapeSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadShapeSelection ), NULL, this ); m_trapDeltaCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_trapAxisCtrl->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 1dfe724e5a..730536f4e5 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -317,7 +317,7 @@ 0 1 - m_PadType + m_padType 1 @@ -386,7 +386,7 @@ 0 1 - m_PadNumText + m_padNumLabel 1 @@ -449,7 +449,7 @@ 0 1 - m_PadNumCtrl + m_padNumCtrl 1 @@ -518,7 +518,7 @@ 0 1 - m_PadNameText + m_padNetLabel 1 @@ -584,7 +584,7 @@ 0 1 - m_PadNetSelector + m_padNetSelector 1 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index f8361a9026..24a3d5339f 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -64,11 +64,11 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxPanel* m_panelGeneral; wxBoxSizer* m_LeftBoxSizer; wxStaticText* m_padTypeLabel; - wxChoice* m_PadType; - wxStaticText* m_PadNumText; - wxTextCtrl* m_PadNumCtrl; - wxStaticText* m_PadNameText; - NET_SELECTOR* m_PadNetSelector; + wxChoice* m_padType; + wxStaticText* m_padNumLabel; + wxTextCtrl* m_padNumCtrl; + wxStaticText* m_padNetLabel; + NET_SELECTOR* m_padNetSelector; wxStaticText* m_posXLabel; wxTextCtrl* m_posXCtrl; wxStaticText* m_posXUnits; diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index ccda93d459..3b2e56b305 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -26,9 +26,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -45,7 +43,6 @@ PAD_TOOL::PAD_TOOL() : PCB_TOOL_BASE( "pcbnew.PadTool" ), - m_padCopied( false ), m_wasHighContrast( false ), m_editPad( niluuid ) {} @@ -60,7 +57,6 @@ void PAD_TOOL::Reset( RESET_REASON aReason ) if( aReason == MODEL_RELOAD ) m_lastPadNumber = wxT( "1" ); - m_padCopied = false; m_editPad = niluuid; } @@ -164,7 +160,6 @@ int PAD_TOOL::copyPadSettings( const TOOL_EVENT& aEvent ) { const PAD& selPad = static_cast( *item ); frame()->GetDesignSettings().m_Pad_Master->ImportSettingsFrom( selPad ); - m_padCopied = true; } } diff --git a/pcbnew/tools/pad_tool.h b/pcbnew/tools/pad_tool.h index f2cd35c4aa..dc4614d9e8 100644 --- a/pcbnew/tools/pad_tool.h +++ b/pcbnew/tools/pad_tool.h @@ -79,7 +79,6 @@ private: void recombinePad( PAD* aPad ); wxString m_lastPadNumber; - bool m_padCopied; // Indicates there are valid settings in the Master Pad object bool m_wasHighContrast; KIID m_editPad;