pcbnew: Prevent using "edit width" in dialogs

Editing predefined tracks/nets/vias sizes makes sense in the toolbar but
not inside the submenu.
This commit is contained in:
Seth Hillbrand 2019-02-08 05:50:20 -08:00
parent edc73de023
commit e1bce7dccd
3 changed files with 16 additions and 10 deletions

View File

@ -117,8 +117,8 @@ DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS( PCB_EDIT
buildFilterLists();
m_parent->UpdateTrackWidthSelectBox( m_trackWidthSelectBox );
m_parent->UpdateViaSizeSelectBox( m_viaSizesSelectBox );
m_parent->UpdateTrackWidthSelectBox( m_trackWidthSelectBox, false );
m_parent->UpdateViaSizeSelectBox( m_viaSizesSelectBox, false );
m_layerBox->SetBoardFrame( m_parent );
m_layerBox->SetLayersHotkeys( false );

View File

@ -353,8 +353,8 @@ public:
void OnUpdatePCBFromSch( wxCommandEvent& event );
void OnRunEeschema( wxCommandEvent& event );
void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox );
void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox );
void UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, const bool aEdit = true );
void UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, const bool aEdit = true );
void GetKicadAbout( wxCommandEvent& event );

View File

@ -656,7 +656,7 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar()
}
void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox )
void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox, const bool aEdit )
{
if( aTrackWidthSelectBox == NULL )
return;
@ -687,8 +687,11 @@ void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox )
aTrackWidthSelectBox->Append( msg );
}
aTrackWidthSelectBox->Append( wxT( "---" ) );
aTrackWidthSelectBox->Append( _( "Edit pre-defined sizes..." ) );
if( aEdit )
{
aTrackWidthSelectBox->Append( wxT( "---" ) );
aTrackWidthSelectBox->Append( _( "Edit pre-defined sizes..." ) );
}
if( GetDesignSettings().GetTrackWidthIndex() >= GetDesignSettings().m_TrackWidthList.size() )
GetDesignSettings().SetTrackWidthIndex( 0 );
@ -697,7 +700,7 @@ void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox )
}
void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox )
void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, const bool aEdit )
{
if( aViaSizeSelectBox == NULL )
return;
@ -736,8 +739,11 @@ void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox )
aViaSizeSelectBox->Append( msg );
}
aViaSizeSelectBox->Append( wxT( "---" ) );
aViaSizeSelectBox->Append( _( "Edit pre-defined sizes..." ) );
if( aEdit )
{
aViaSizeSelectBox->Append( wxT( "---" ) );
aViaSizeSelectBox->Append( _( "Edit pre-defined sizes..." ) );
}
if( GetDesignSettings().GetViaSizeIndex() >= GetDesignSettings().m_ViasDimensionsList.size() )
GetDesignSettings().SetViaSizeIndex( 0 );