diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index b79b52cfa7..409bfcf002 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -245,6 +245,7 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, // Run the callbacks once to process the dialog contents setControlEnablement(); + setCircularArrayEnablement(); calculateCircularArrayProperties(); SetupStandardButtons(); @@ -252,18 +253,20 @@ DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, SetMinSize( GetSize() ); } + void DIALOG_CREATE_ARRAY::OnButtonPosition( wxCommandEvent& event ) { - if( m_radioBtnSetByPos->GetValue() ) - { - m_entryCentreX->Enable(); - m_entryCentreY->Enable(); - m_tcValueCircRadius->Disable(); - m_tcValueCircCenterAngle->Disable(); - } + setCircularArrayEnablement(); } + void DIALOG_CREATE_ARRAY::OnButtonRadius( wxCommandEvent& event ) +{ + setCircularArrayEnablement(); +} + + +void DIALOG_CREATE_ARRAY::setCircularArrayEnablement() { if( m_radioBtnSetByRadius->GetValue() ) { @@ -272,17 +275,22 @@ void DIALOG_CREATE_ARRAY::OnButtonRadius( wxCommandEvent& event ) m_tcValueCircRadius->Enable(); m_tcValueCircCenterAngle->Enable(); } -} - -void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) -{ - if( m_radioBtnSetByPos->GetValue() ) + else { m_entryCentreX->Enable(); m_entryCentreY->Enable(); m_tcValueCircRadius->Disable(); m_tcValueCircCenterAngle->Disable(); + } +} + +void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) +{ + setCircularArrayEnablement(); + + if( m_radioBtnSetByPos->GetValue() ) + { setControlEnablement(); calculateCircularArrayProperties(); } @@ -290,13 +298,10 @@ void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event ) void DIALOG_CREATE_ARRAY::OnRadiusChanged( wxCommandEvent& event ) { + setCircularArrayEnablement(); + if( m_radioBtnSetByRadius->GetValue() ) { - m_entryCentreX->Disable(); - m_entryCentreY->Disable(); - m_tcValueCircRadius->Enable(); - m_tcValueCircCenterAngle->Enable(); - setControlEnablement(); calculateCircularArrayProperties(); } diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h index 8523fe6093..899e61345e 100644 --- a/pcbnew/dialogs/dialog_create_array.h +++ b/pcbnew/dialogs/dialog_create_array.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015 John Beard, john.j.beard@gmail.com - * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -61,6 +61,7 @@ private: // Internal callback handlers void setControlEnablement(); + void setCircularArrayEnablement(); void calculateCircularArrayProperties(); bool TransferDataFromWindow() override; diff --git a/pcbnew/dialogs/dialog_create_array_base.cpp b/pcbnew/dialogs/dialog_create_array_base.cpp index a6a4790e7c..38d4786ecb 100644 --- a/pcbnew/dialogs/dialog_create_array_base.cpp +++ b/pcbnew/dialogs/dialog_create_array_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_create_array_base.h b/pcbnew/dialogs/dialog_create_array_base.h index df56c7fd3b..d8cc0f4799 100644 --- a/pcbnew/dialogs/dialog_create_array_base.h +++ b/pcbnew/dialogs/dialog_create_array_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) +// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE!