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.
This commit is contained in:
Bastian Neumann 2017-08-28 21:45:50 +02:00 committed by Wayne Stambaugh
parent 758445e33e
commit 9b900ea834
2 changed files with 10 additions and 3 deletions

View File

@ -291,6 +291,7 @@ void DIALOG_DESIGN_RULES::InitGlobalRules()
m_OptAllowBlindBuriedVias->SetValue( m_BrdSettings->m_BlindBuriedViaAllowed ); m_OptAllowBlindBuriedVias->SetValue( m_BrdSettings->m_BlindBuriedViaAllowed );
m_OptAllowMicroVias->SetValue( m_BrdSettings->m_MicroViasAllowed ); m_OptAllowMicroVias->SetValue( m_BrdSettings->m_MicroViasAllowed );
CheckAllowMicroVias();
PutValueInLocalUnits( *m_SetMicroViasMinSizeCtrl, m_BrdSettings->m_MicroViasMinSize ); PutValueInLocalUnits( *m_SetMicroViasMinSizeCtrl, m_BrdSettings->m_MicroViasMinSize );
PutValueInLocalUnits( *m_SetMicroViasMinDrillCtrl, m_BrdSettings->m_MicroViasMinDrill ); 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 * Function OnAllowMicroVias
* is called whenever the AllowMicroVias checkbox is toggled * is called whenever the AllowMicroVias checkbox is toggled
*/ */
void DIALOG_DESIGN_RULES::OnAllowMicroVias( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnAllowMicroVias( wxCommandEvent& event )
{ {
bool enabled = m_OptAllowMicroVias->GetValue(); CheckAllowMicroVias();
m_SetMicroViasMinSizeCtrl->Enable( enabled );
m_SetMicroViasMinDrillCtrl->Enable( enabled );
} }
void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event ) void DIALOG_DESIGN_RULES::OnMoveUpSelectedNetClass( wxCommandEvent& event )

View File

@ -95,6 +95,7 @@ private:
void OnNetClassesNameRightClick( wxGridEvent& event ) override { event.Skip(); } void OnNetClassesNameRightClick( wxGridEvent& event ) override { event.Skip(); }
void OnAddNetclassClick( wxCommandEvent& event ) override; void OnAddNetclassClick( wxCommandEvent& event ) override;
void OnRemoveNetclassClick( wxCommandEvent& event ) override; void OnRemoveNetclassClick( wxCommandEvent& event ) override;
void CheckAllowMicroVias();
void OnAllowMicroVias( wxCommandEvent& event ) override; void OnAllowMicroVias( wxCommandEvent& event ) override;
/* /*