Browse Source

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.
pull/7/merge
Bastian Neumann 8 years ago
committed by Wayne Stambaugh
parent
commit
9b900ea834
  1. 12
      pcbnew/dialogs/dialog_design_rules.cpp
  2. 1
      pcbnew/dialogs/dialog_design_rules.h

12
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 )

1
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;
/*

Loading…
Cancel
Save