diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 47eb0f0086..bbbcdcd846 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -136,6 +137,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad m_thermalGap( aParent, m_thermalGapLabel, m_thermalGapCtrl, m_thermalGapUnits, true ) { SetName( PAD_PROPERTIES_DLG_NAME ); + m_isFpEditor = dynamic_cast( aParent ) != nullptr; m_currentPad = aPad; // aPad can be NULL, if the dialog is called // from the footprint editor to set default pad setup @@ -189,7 +191,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad m_staticTextPrimitiveListWarning->SetFont( infoFont ); // Do not allow locking items in the footprint editor - m_locked->Show( dynamic_cast( aParent ) != nullptr ); + m_locked->Show( !m_isFpEditor ); // Usually, TransferDataToWindow is called by OnInitDialog // calling it here fixes all widget sizes so FinishDialogSettings can safely fix minsizes @@ -994,8 +996,8 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) { // Enable/disable position - m_posX.Enable( !m_locked->GetValue() ); - m_posY.Enable( !m_locked->GetValue() ); + m_posX.Enable( !m_locked->GetValue() || m_isFpEditor ); + m_posY.Enable( !m_locked->GetValue() || m_isFpEditor ); bool hasHole = true; bool hasConnection = true; @@ -1547,7 +1549,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() m_currentPad->SetLocked( m_locked->GetValue() ); - if( !m_locked->GetValue() ) + if( !m_locked->GetValue() || m_isFpEditor ) m_currentPad->SetPosition( m_padMaster->GetPosition() ); wxSize size; diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index df2ce6d93a..eadbd78d8c 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -64,6 +64,7 @@ private: // which case some Y coordinates values must be negated bool m_canUpdate; bool m_canEditNetName; // true only if the caller is the board editor + bool m_isFpEditor; // true if the caller is the footprint editor std::vector> m_primitives; // the custom shape primitives in // local coords, orient 0