Harmonize interchangeable units checkboxes.

Fixes https://gitlab.com/kicad/code/kicad/issues/10708
This commit is contained in:
Jeff Young 2022-02-06 13:23:08 +00:00
parent cc69849719
commit b1cc784582
6 changed files with 10 additions and 10 deletions

View File

@ -71,7 +71,7 @@ void DIALOG_LIB_NEW_SYMBOL::syncControls( bool aIsDerivedPart )
m_textReference->Enable( !aIsDerivedPart );
m_staticTextUnits->Enable( !aIsDerivedPart );
m_spinPartCount->Enable( !aIsDerivedPart );
m_checkLockItems->Enable( !aIsDerivedPart );
m_checkUnitsInterchangeable->Enable( !aIsDerivedPart );
m_checkHasConversion->Enable( !aIsDerivedPart );
m_checkIsPowerSymbol->Enable( !aIsDerivedPart );
m_excludeFromBomCheckBox->Enable( !aIsDerivedPart );

View File

@ -65,8 +65,8 @@ public:
void SetPowerSymbol( bool enable ) { m_checkIsPowerSymbol->SetValue( enable ); }
bool GetPowerSymbol( void ) { return m_checkIsPowerSymbol->GetValue(); }
void SetLockItems( bool enable ) { m_checkLockItems->SetValue( enable ); }
bool GetLockItems( void ) { return m_checkLockItems->GetValue(); }
void SetUnitsInterchangeable( bool enable ) { m_checkUnitsInterchangeable->SetValue( enable ); }
bool GetUnitsInterchangeable( void ) { return m_checkUnitsInterchangeable->GetValue(); }
void SetIncludeInBom( bool aInclude ) { m_excludeFromBomCheckBox->SetValue( !aInclude ); }
bool GetIncludeInBom() const { return !m_excludeFromBomCheckBox->GetValue(); }

View File

@ -68,10 +68,10 @@ DIALOG_LIB_NEW_SYMBOL_BASE::DIALOG_LIB_NEW_SYMBOL_BASE( wxWindow* parent, wxWind
wxBoxSizer* bSizer17;
bSizer17 = new wxBoxSizer( wxVERTICAL );
m_checkLockItems = new wxCheckBox( this, wxID_ANY, _("Units are not interchangeable"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkLockItems->SetToolTip( _("Check this option to allow symbols with multiple units to have different\nelements. Uncheck this option when all symbol units are identical except\nfor pin numbers.") );
m_checkUnitsInterchangeable = new wxCheckBox( this, wxID_ANY, _("All units are interchangeable"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkUnitsInterchangeable->SetToolTip( _("Check this option to allow symbols with multiple units to have different\nelements. Uncheck this option when all symbol units are identical except\nfor pin numbers.") );
bSizer17->Add( m_checkLockItems, 0, wxRIGHT|wxLEFT, 5 );
bSizer17->Add( m_checkUnitsInterchangeable, 0, wxRIGHT|wxLEFT, 5 );
m_checkHasConversion = new wxCheckBox( this, wxID_ANY, _("Create symbol with alternate body style (De Morgan)"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer17->Add( m_checkHasConversion, 0, wxTOP|wxRIGHT|wxLEFT, 5 );

View File

@ -627,7 +627,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Units are not interchangeable</property>
<property name="label">All units are interchangeable</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -635,7 +635,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkLockItems</property>
<property name="name">m_checkUnitsInterchangeable</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -49,7 +49,7 @@ class DIALOG_LIB_NEW_SYMBOL_BASE : public DIALOG_SHIM
wxTextCtrl* m_textReference;
wxStaticText* m_staticTextUnits;
wxSpinCtrl* m_spinPartCount;
wxCheckBox* m_checkLockItems;
wxCheckBox* m_checkUnitsInterchangeable;
wxCheckBox* m_checkHasConversion;
wxCheckBox* m_checkIsPowerSymbol;
wxCheckBox* m_excludeFromBomCheckBox;

View File

@ -481,7 +481,7 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol()
( dlg.GetPowerSymbol() ) ? new_symbol.SetPower() : new_symbol.SetNormal();
new_symbol.SetShowPinNumbers( dlg.GetShowPinNumber() );
new_symbol.SetShowPinNames( dlg.GetShowPinName() );
new_symbol.LockUnits( dlg.GetLockItems() );
new_symbol.LockUnits( !dlg.GetUnitsInterchangeable() );
new_symbol.SetIncludeInBom( dlg.GetIncludeInBom() );
new_symbol.SetIncludeOnBoard( dlg.GetIncludeOnBoard() );