diff --git a/common/base_screen.cpp b/common/base_screen.cpp index 84c253e99a..13399d6a07 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -194,7 +194,12 @@ int BASE_SCREEN::BuildGridsChoiceList( wxArrayString& aGridsList, bool aMmFirst) if( grid.m_CmdId == ID_POPUP_GRID_USER ) { - msg = _( "Custom User Grid" ); + if( aMmFirst ) + msg.Printf( _( "User grid: %.4f mm (%.2f mils)" ), + gridValue_mm, gridValueMils ); + else + msg.Printf( _( "User grid: %.2f mils (%.4f mm)" ), + gridValueMils, gridValue_mm ); idx_usergrid = i; } else diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index e8ab532a6e..7198e07b2e 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -444,6 +444,29 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent ) } +void EDA_DRAW_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) +{ + // No need to update the grid select box if it doesn't exist or the grid setting change + // was made using the select box. + if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL ) + return; + + int select = wxNOT_FOUND; + + for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) + { + if( GetScreen()->GetGridCmdId() == GetScreen()->GetGrid( i ).m_CmdId ) + { + select = (int) i; + break; + } + } + + if( select != m_gridSelectBox->GetSelection() ) + m_gridSelectBox->SetSelection( select ); +} + + void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ) { aEvent.Check( GetGalDisplayOptions().m_fullscreenCursor ); @@ -506,6 +529,23 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) */ int index = m_gridSelectBox->GetSelection(); wxASSERT( index != wxNOT_FOUND ); + + if( index == m_gridSelectBox->GetCount() - 2 ) + { + // this is the separator + wxUpdateUIEvent dummy; + OnUpdateSelectGrid( dummy ); + return; + } + else if( index == m_gridSelectBox->GetCount() - 1 ) + { + wxUpdateUIEvent dummy; + OnUpdateSelectGrid( dummy ); + wxCommandEvent dummy2; + OnGridSettings( dummy2 ); + return; + } + clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index ); if( clientData != NULL ) diff --git a/common/legacy_wx/eda_draw_frame.cpp b/common/legacy_wx/eda_draw_frame.cpp index 60ad51cec0..488b11957b 100644 --- a/common/legacy_wx/eda_draw_frame.cpp +++ b/common/legacy_wx/eda_draw_frame.cpp @@ -447,6 +447,29 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent ) } +void EDA_DRAW_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) +{ + // No need to update the grid select box if it doesn't exist or the grid setting change + // was made using the select box. + if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL ) + return; + + int select = wxNOT_FOUND; + + for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) + { + if( GetScreen()->GetGridCmdId() == GetScreen()->GetGrid( i ).m_CmdId ) + { + select = (int) i; + break; + } + } + + if( select != m_gridSelectBox->GetSelection() ) + m_gridSelectBox->SetSelection( select ); +} + + void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ) { aEvent.Check( GetGalDisplayOptions().m_fullscreenCursor ); @@ -507,6 +530,23 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) */ int index = m_gridSelectBox->GetSelection(); wxASSERT( index != wxNOT_FOUND ); + + if( index == m_gridSelectBox->GetCount() - 2 ) + { + // this is the separator + wxUpdateUIEvent dummy; + OnUpdateSelectGrid( dummy ); + return; + } + else if( index == m_gridSelectBox->GetCount() - 1 ) + { + wxUpdateUIEvent dummy; + OnUpdateSelectGrid( dummy ); + wxCommandEvent dummy2; + OnGridSettings( dummy2 ); + return; + } + clientData = (int*) m_gridSelectBox->wxItemContainer::GetClientData( index ); if( clientData != NULL ) @@ -519,15 +559,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) int idx = eventId - ID_POPUP_GRID_LEVEL_1000; - // Notify GAL - TOOL_MANAGER* mgr = GetToolManager(); - - if( mgr && IsGalCanvasActive() ) - { - mgr->RunAction( "common.Control.gridPreset", true, idx ); - } - else - SetPresetGrid( idx ); + SetPresetGrid( idx ); m_canvas->Refresh(); } diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index 3098be5355..a47f9335c0 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -102,6 +102,13 @@ void PAGED_DIALOG::finishInitialization() } +void PAGED_DIALOG::SetInitialPage( const wxString& aPage, const wxString& aParentPage ) +{ + g_lastPage[ m_title ] = aPage; + g_lastParentPage[ m_title ] = aParentPage; +} + + PAGED_DIALOG::~PAGED_DIALOG() { // Store the current parentPageTitle/pageTitle hierarchy so we can re-select it @@ -154,17 +161,17 @@ bool PAGED_DIALOG::TransferDataToWindow() { if( m_treebook->GetPageText( i ) == lastPage ) { - int parent = m_treebook->GetPageParent( i ); - - if( parent == wxNOT_FOUND ) + if( lastParentPage.IsEmpty() ) { - if( lastParentPage.IsEmpty() ) - lastPageIndex = i; + lastPageIndex = i; + break; } - else + + if( m_treebook->GetPageParent( i ) >= 0 + && m_treebook->GetPageText( (unsigned) m_treebook->GetPageParent( i ) ) == lastParentPage ) { - if( lastParentPage == m_treebook->GetPageText( (unsigned) parent ) ) - lastPageIndex = i; + lastPageIndex = i; + break; } } } diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 87c024af3f..a3c1c99673 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -168,7 +168,7 @@ public: } void SetGridOrigin( const wxPoint& aPoint ) override {} - void OnGridSettings( wxCommandEvent& aEvent ); + void OnGridSettings( wxCommandEvent& aEvent ) override; const TITLE_BLOCK& GetTitleBlock() const override; void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 2902d0a177..983c873941 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1285,29 +1285,6 @@ void GERBVIEW_FRAME::updateZoomSelectBox() } -void GERBVIEW_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) -{ - // No need to update the grid select box if it doesn't exist or the grid setting change - // was made using the select box. - if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL ) - return; - - int select = wxNOT_FOUND; - - for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) - { - if( GetScreen()->GetGridCmdId() == GetScreen()->GetGrid( i ).m_CmdId ) - { - select = (int) i; - break; - } - } - - if( select != m_gridSelectBox->GetSelection() ) - m_gridSelectBox->SetSelection( select ); -} - - void GERBVIEW_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) { if( m_zoomSelectBox == NULL || m_auxiliaryToolBar == NULL ) diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index b6463beb43..8697fe6b26 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -250,7 +250,6 @@ public: void OnLeftDClick( wxDC* aDC, const wxPoint& aMousePos ) override; bool OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) override; void OnUpdateSelectTool( wxUpdateUIEvent& aEvent ); - void OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ); void OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ); double BestZoom() override; void UpdateStatusBar() override; diff --git a/include/draw_frame.h b/include/draw_frame.h index bba65be5fc..7fc14861bf 100644 --- a/include/draw_frame.h +++ b/include/draw_frame.h @@ -594,6 +594,8 @@ public: */ virtual void OnSelectGrid( wxCommandEvent& event ); + virtual void OnGridSettings( wxCommandEvent& event ) { }; + /** * Set the zoom factor when selected by the zoom list box in the main tool bar. * @@ -613,6 +615,7 @@ public: void OnUpdateUndo( wxUpdateUIEvent& aEvent ); void OnUpdateRedo( wxUpdateUIEvent& aEvent ); void OnUpdateGrid( wxUpdateUIEvent& aEvent ); + void OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ); void OnUpdateUnits( wxUpdateUIEvent& aEvent ); void OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ); diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index b9dc62f41e..25d3b0aef6 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -563,8 +563,6 @@ public: void CommonSettingsChanged() override; - bool InvokeDialogGrid(); - void OnTogglePolarCoords( wxCommandEvent& aEvent ); void OnTogglePadDrawMode( wxCommandEvent& aEvent ); void OnToggleGraphicDrawMode( wxCommandEvent& aEvent ); @@ -579,7 +577,6 @@ public: void OnUpdateGraphicDrawMode( wxUpdateUIEvent& aEvent ); void OnUpdateEdgeDrawMode( wxUpdateUIEvent& aEvent ); void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent ); - void OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ); void OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ); virtual void OnUpdateLayerAlpha( wxUpdateUIEvent& aEvent ) {} diff --git a/include/widgets/paged_dialog.h b/include/widgets/paged_dialog.h index 9fffe2817c..516590eac5 100644 --- a/include/widgets/paged_dialog.h +++ b/include/widgets/paged_dialog.h @@ -42,6 +42,8 @@ public: wxTreebook* GetTreebook() { return m_treebook; } + void SetInitialPage( const wxString& aPage, const wxString& aParentPage = wxEmptyString ); + void SetError( const wxString& aMessage, wxWindow* aPage, wxObject* aCtrl, int aRow = -1, int aCol = -1 ); diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index 7ab1caa517..d47759651c 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -39,6 +39,11 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_tracksAndVias = new PANEL_SETUP_TRACKS_AND_VIAS( this, aFrame, m_constraints ); m_maskAndPaste = new PANEL_SETUP_MASK_AND_PASTE( this, aFrame ); + /* + * WARNING: If you change page names you MUST update callers which specifiy a + * particular page to be in sync. + */ + m_treebook->AddPage( m_layers, _( "Layers" ) ); m_treebook->AddSubPage( m_textAndGraphics, _( "Text & Graphics" ) ); diff --git a/pcbnew/dialogs/dialog_set_grid.cpp b/pcbnew/dialogs/dialog_set_grid.cpp index 0aa5301d0c..da9662fedf 100644 --- a/pcbnew/dialogs/dialog_set_grid.cpp +++ b/pcbnew/dialogs/dialog_set_grid.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -168,8 +168,14 @@ void DIALOG_SET_GRID::OnResetGridOrgClick( wxCommandEvent& event ) } -bool PCB_BASE_FRAME::InvokeDialogGrid() +bool PCB_BASE_EDIT_FRAME::InvokeDialogGrid() { DIALOG_SET_GRID dlg( this, m_gridSelectBox->GetStrings() ); return dlg.ShowModal(); } + + +void PCB_BASE_EDIT_FRAME::OnGridSettings( wxCommandEvent& event ) +{ + InvokeDialogGrid(); +} diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 8e192d81a4..e2baa15177 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -77,7 +77,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) { case wxID_CUT: case wxID_COPY: - case ID_PCB_USER_GRID_SETUP: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR: case ID_POPUP_PCB_ROTATE_TEXTEPCB: @@ -1227,10 +1226,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) Swap_Layers( event ); break; - case ID_PCB_USER_GRID_SETUP: - InvokeDialogGrid(); - break; - case ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC: { wxConfigBase* cfg = Pgm().CommonSettings(); diff --git a/pcbnew/event_handlers_tracks_vias_sizes.cpp b/pcbnew/event_handlers_tracks_vias_sizes.cpp index 98ed3a730b..38c900edbc 100644 --- a/pcbnew/event_handlers_tracks_vias_sizes.cpp +++ b/pcbnew/event_handlers_tracks_vias_sizes.cpp @@ -117,13 +117,39 @@ void PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event( wxCommandEvent& event ) break; case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH: - ii = m_SelTrackWidthBox->GetCurrentSelection(); - GetDesignSettings().SetTrackWidthIndex( ii ); + ii = m_SelTrackWidthBox->GetSelection(); + + if( ii == m_SelViaSizeBox->GetCount() - 2 ) + { + // this is the separator + m_SelTrackWidthBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() ); + } + else if( ii == m_SelTrackWidthBox->GetCount() - 1 ) + { + m_SelTrackWidthBox->SetSelection( GetDesignSettings().GetTrackWidthIndex() ); + DoShowBoardSetupDialog( _( "Tracks & Vias" ) ); + } + else + GetDesignSettings().SetTrackWidthIndex( ii ); + break; case ID_AUX_TOOLBAR_PCB_VIA_SIZE: - ii = m_SelViaSizeBox->GetCurrentSelection(); - GetDesignSettings().SetViaSizeIndex( ii ); + ii = m_SelViaSizeBox->GetSelection(); + + if( ii == m_SelViaSizeBox->GetCount() - 2 ) + { + // this is the separator + m_SelViaSizeBox->SetSelection( GetDesignSettings().GetViaSizeIndex() ); + } + else if( ii == m_SelViaSizeBox->GetCount() - 1 ) + { + m_SelViaSizeBox->SetSelection( GetDesignSettings().GetViaSizeIndex() ); + DoShowBoardSetupDialog( _( "Tracks & Vias" ) ); + } + else + GetDesignSettings().SetViaSizeIndex( ii ); + break; default: diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 478d20ccbb..40ef7bc35b 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -164,7 +164,7 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_MODEDIT_MODULE_MIRROR, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MODEDIT_MODULE_MOVE_EXACT, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) - EVT_MENU( ID_PCB_USER_GRID_SETUP, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_PCB_USER_GRID_SETUP, FOOTPRINT_EDIT_FRAME::OnGridSettings ) // Menu Help EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp ) diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 23f6254cc1..902382350e 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -249,7 +249,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) case wxID_COPY: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_MODEDIT_PAD_SETTINGS: - case ID_PCB_USER_GRID_SETUP: case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_ROTATE_TEXTMODULE: @@ -745,10 +744,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) m_canvas->Refresh(); break; - case ID_PCB_USER_GRID_SETUP: - InvokeDialogGrid(); - break; - case ID_POPUP_PLACE_BLOCK: GetScreen()->m_BlockLocate.SetCommand( BLOCK_MOVE ); m_canvas->SetAutoPanRequest( false ); diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index b3de5c28ce..e860ea57d5 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -172,6 +172,9 @@ public: ///> @copydoc PCB_BASE_FRAME::SetBoard() virtual void SetBoard( BOARD* aBoard ) override; + void OnGridSettings( wxCommandEvent& aEvent ) override; + bool InvokeDialogGrid(); + protected: /// User defined rotation angle (in tenths of a degree). int m_rotationAngle; diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index cec7dff7d3..cb077a2e51 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -677,29 +677,6 @@ void PCB_BASE_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent ) } -void PCB_BASE_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent ) -{ - // No need to update the grid select box if it doesn't exist or the grid setting change - // was made using the select box. - if( m_gridSelectBox == NULL || m_auxiliaryToolBar == NULL ) - return; - - int select = wxNOT_FOUND; - - for( size_t i = 0; i < GetScreen()->GetGridCount(); i++ ) - { - if( GetScreen()->GetGridCmdId() == GetScreen()->GetGrid( i ).m_CmdId ) - { - select = (int) i; - break; - } - } - - if( select != m_gridSelectBox->GetSelection() ) - m_gridSelectBox->SetSelection( select ); -} - - void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent ) { if( m_zoomSelectBox == NULL || m_zoomSelectBox->GetParent() == NULL ) @@ -1053,6 +1030,9 @@ void PCB_BASE_FRAME::updateGridSelectBox() m_gridSelectBox->Append( gridsList[i], (void*) &grid.m_CmdId ); } + m_gridSelectBox->Append( wxT( "---" ) ); + m_gridSelectBox->Append( _( "Edit user grid..." ) ); + m_gridSelectBox->SetSelection( icurr ); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 5e4d70c63c..b21517831a 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -144,7 +144,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_PREFERENCES_CONFIGURE_PATHS, PCB_EDIT_FRAME::OnConfigurePaths ) EVT_MENU( ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST, PCB_EDIT_FRAME::Process_Config ) EVT_MENU( wxID_PREFERENCES, PCB_EDIT_FRAME::Process_Config ) - EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::Process_Special_Functions ) + EVT_MENU( ID_PCB_USER_GRID_SETUP, PCB_EDIT_FRAME::OnGridSettings ) // menu Postprocess EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenFootprintsPositionFile ) @@ -719,9 +719,19 @@ void PCB_EDIT_FRAME::enableGALSpecificMenus() void PCB_EDIT_FRAME::ShowBoardSetupDialog( wxCommandEvent& event ) +{ + DoShowBoardSetupDialog(); +} + + +void PCB_EDIT_FRAME::DoShowBoardSetupDialog( const wxString& aInitialPage, + const wxString& aInitialParentPage ) { DIALOG_BOARD_SETUP dlg( this ); + if( !aInitialPage.IsEmpty() ) + dlg.SetInitialPage( aInitialPage, aInitialParentPage ); + if( dlg.ShowModal() == wxID_OK ) { Prj().ConfigSave( Kiface().KifaceSearch(), GROUP_PCB, GetProjectFileParameters() ); diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 1cd1e18909..b25fd8000e 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -708,6 +708,8 @@ public: * Function ShowBoardSetupDialog */ void ShowBoardSetupDialog( wxCommandEvent& event ); + void DoShowBoardSetupDialog( const wxString& aInitialPage = wxEmptyString, + const wxString& aInitialParentPage = wxEmptyString ); /* toolbars update UI functions: */ diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/tool_pcb_editor.cpp index f6f3c50bd7..f24bc2be4f 100644 --- a/pcbnew/tool_pcb_editor.cpp +++ b/pcbnew/tool_pcb_editor.cpp @@ -661,6 +661,9 @@ void PCB_EDIT_FRAME::UpdateTrackWidthSelectBox( wxChoice* aTrackWidthSelectBox ) aTrackWidthSelectBox->Append( msg ); } + aTrackWidthSelectBox->Append( wxT( "---" ) ); + aTrackWidthSelectBox->Append( _( "Edit pre-defined sizes..." ) ); + if( GetDesignSettings().GetTrackWidthIndex() >= GetDesignSettings().m_TrackWidthList.size() ) GetDesignSettings().SetTrackWidthIndex( 0 ); @@ -707,6 +710,9 @@ void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox ) aViaSizeSelectBox->Append( msg ); } + aViaSizeSelectBox->Append( wxT( "---" ) ); + aViaSizeSelectBox->Append( _( "Edit pre-defined sizes..." ) ); + if( GetDesignSettings().GetViaSizeIndex() >= GetDesignSettings().m_ViasDimensionsList.size() ) GetDesignSettings().SetViaSizeIndex( 0 );