pcbnew: Correctly set the radio buttons in fpeditor

Radio buttons always have one set, so we need a single path to setting
the correct button.
This commit is contained in:
Seth Hillbrand 2019-02-18 11:55:22 -08:00
parent 2dd653a327
commit 525b9bd550
1 changed files with 11 additions and 6 deletions

View File

@ -269,13 +269,18 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow()
m_posY.SetValue( m_footprint->GetPosition().y );
m_OrientValue = m_footprint->GetOrientation() / 10.0;
m_Orient0->SetValue( m_OrientValue == 0.0 );
m_Orient90->SetValue( m_OrientValue == 90.0 || m_OrientValue == -270.0 );
m_Orient270->SetValue( m_OrientValue == 270.0 || m_OrientValue == -90.0 );
m_Orient180->SetValue( m_OrientValue == 180.0 || m_OrientValue == -180.0 );
m_OrientOther->SetValue( !m_Orient0->GetValue() && !m_Orient90->GetValue()
&& !m_Orient270->GetValue() && !m_Orient180->GetValue() );
if( m_OrientValue == 0.0 )
m_Orient0->SetValue( true );
else if( m_OrientValue == 90.0 || m_OrientValue == -270.0 )
m_Orient90->SetValue( true );
else if( m_OrientValue == 270.0 || m_OrientValue == -90.0 )
m_Orient270->SetValue( true );
else if( m_OrientValue == 180.0 || m_OrientValue == -180.0 )
m_Orient180->SetValue( true );
else
m_OrientOther->SetValue( true );
m_OrientValidator.TransferToWindow();
m_BoardSideCtrl->SetSelection( (m_footprint->GetLayer() == B_Cu) ? 1 : 0 );