From 9b900ea834cb753099cdac0cfaa2db82bca1efea Mon Sep 17 00:00:00 2001 From: Bastian Neumann Date: Mon, 28 Aug 2017 21:45:50 +0200 Subject: [PATCH] Micro via input fields are enabled when design is loaded Loading a design with micro vias enabled did check the box for enabling micro vias in pcbnew. The value input fields for diameter and drill size were not enabled. This patch moves the functionality into an new function and calls that from the onclick event of the checkbox and the init function of the dialog. --- pcbnew/dialogs/dialog_design_rules.cpp | 12 +++++++++--- pcbnew/dialogs/dialog_design_rules.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pcbnew/dialogs/dialog_design_rules.cpp b/pcbnew/dialogs/dialog_design_rules.cpp index 1de2f1ba21..64f5d8f8a9 100644 --- a/pcbnew/dialogs/dialog_design_rules.cpp +++ b/pcbnew/dialogs/dialog_design_rules.cpp @@ -291,6 +291,7 @@ void DIALOG_DESIGN_RULES::InitGlobalRules() m_OptAllowBlindBuriedVias->SetValue( m_BrdSettings->m_BlindBuriedViaAllowed ); m_OptAllowMicroVias->SetValue( m_BrdSettings->m_MicroViasAllowed ); + CheckAllowMicroVias(); PutValueInLocalUnits( *m_SetMicroViasMinSizeCtrl, m_BrdSettings->m_MicroViasMinSize ); PutValueInLocalUnits( *m_SetMicroViasMinDrillCtrl, m_BrdSettings->m_MicroViasMinDrill ); @@ -808,15 +809,20 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event ) } } +void DIALOG_DESIGN_RULES::CheckAllowMicroVias() +{ + bool enabled = m_OptAllowMicroVias->GetValue(); + m_SetMicroViasMinSizeCtrl->Enable( enabled ); + m_SetMicroViasMinDrillCtrl->Enable( enabled ); +} + /** * Function OnAllowMicroVias * is called whenever the AllowMicroVias checkbox is toggled */ void DIALOG_DESIGN_RULES::OnAllowMicroVias( wxCommandEvent& event ) { - bool enabled = m_OptAllowMicroVias->GetValue(); - m_SetMicroViasMinSizeCtrl->Enable( enabled ); - m_SetMicroViasMinDrillCtrl->Enable( enabled ); + CheckAllowMicroVias(); } void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event ) diff --git a/pcbnew/dialogs/dialog_design_rules.h b/pcbnew/dialogs/dialog_design_rules.h index 831ab844d4..76dcdbe7ee 100644 --- a/pcbnew/dialogs/dialog_design_rules.h +++ b/pcbnew/dialogs/dialog_design_rules.h @@ -95,6 +95,7 @@ private: void OnNetClassesNameRightClick( wxGridEvent& event ) override { event.Skip(); } void OnAddNetclassClick( wxCommandEvent& event ) override; void OnRemoveNetclassClick( wxCommandEvent& event ) override; + void CheckAllowMicroVias(); void OnAllowMicroVias( wxCommandEvent& event ) override; /*