diff --git a/pcbnew/dialogs/dialog_track_via_properties.cpp b/pcbnew/dialogs/dialog_track_via_properties.cpp index c8f3f2962c..085f8a0dd0 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.cpp +++ b/pcbnew/dialogs/dialog_track_via_properties.cpp @@ -126,6 +126,23 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen } } + assert( m_tracks || m_vias ); + + if( m_vias ) + { + setCommonVal( viaX, m_ViaXCtrl, m_viaX ); + setCommonVal( viaY, m_ViaYCtrl, m_viaY ); + setCommonVal( viaDiameter, m_ViaDiameterCtrl, m_viaDiameter ); + setCommonVal( viaDrill, m_ViaDrillCtrl, m_viaDrill ); + m_ViaDiameterCtrl->SetFocus(); + } + else + { + // you cannot access sizers directly if the code was generated by wxFormBuilder + wxSizer* s = m_viaStaticLine->GetContainingSizer(); + m_mainSizerAccessor->GetContainingSizer()->Hide( s, true ); + } + if( m_tracks ) { setCommonVal( trackStartX, m_TrackStartXCtrl, m_trackStartX ); @@ -141,6 +158,8 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen if( trackLayer ) m_TrackLayerCtrl->SetLayerSelection( *trackLayer ); + + m_TrackWidthCtrl->SetFocus(); } else { @@ -149,20 +168,6 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen m_mainSizerAccessor->GetContainingSizer()->Hide( s, true ); } - if( m_vias ) - { - setCommonVal( viaX, m_ViaXCtrl, m_viaX ); - setCommonVal( viaY, m_ViaYCtrl, m_viaY ); - setCommonVal( viaDiameter, m_ViaDiameterCtrl, m_viaDiameter ); - setCommonVal( viaDrill, m_ViaDrillCtrl, m_viaDrill ); - } - else - { - // you cannot access sizers directly if the code was generated by wxFormBuilder - wxSizer* s = m_viaStaticLine->GetContainingSizer(); - m_mainSizerAccessor->GetContainingSizer()->Hide( s, true ); - } - m_StdButtonsOK->SetDefault(); Layout();