Gray out "Units are not interchangeable" if 1 unit

Fixes: lp:1503921
* https://bugs.launchpad.net/kicad/+bug/1503921
This commit is contained in:
Aylons Hazzud 2016-11-09 21:11:47 -02:00 committed by Maciej Suminski
parent 682c15ed62
commit 5dc43a1d77
5 changed files with 16 additions and 4 deletions

View File

@ -578,3 +578,12 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::EditOneFootprintFilter( wxCommandEvent& e
m_FootprintFilterListBox->SetString( idx, filter ); m_FootprintFilterListBox->SetString( idx, filter );
} }
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateInterchangeableUnits( wxUpdateUIEvent& event )
{
if( m_SelNumberOfUnits->GetValue() <= 1 )
m_OptionPartsLocked->Enable( false );
else
m_OptionPartsLocked->Enable( true );
}

View File

@ -59,11 +59,11 @@ private:
bool SetUnsetConvert(); bool SetUnsetConvert();
void CopyDocFromRootToAlias(wxCommandEvent& event) override; void CopyDocFromRootToAlias(wxCommandEvent& event) override;
void BrowseAndSelectDocFile(wxCommandEvent& event) override; void BrowseAndSelectDocFile(wxCommandEvent& event) override;
void DeleteAllFootprintFilter(wxCommandEvent& event) override; void DeleteAllFootprintFilter(wxCommandEvent& event) override;
void DeleteOneFootprintFilter(wxCommandEvent& event) override; void DeleteOneFootprintFilter(wxCommandEvent& event) override;
void AddFootprintFilter(wxCommandEvent& event) override; void AddFootprintFilter(wxCommandEvent& event) override;
void EditOneFootprintFilter( wxCommandEvent& event ) override; void EditOneFootprintFilter( wxCommandEvent& event ) override;
void OnUpdateInterchangeableUnits( wxUpdateUIEvent& event ) override;
}; };
#endif #endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 28 2015) // C++ code generated with wxFormBuilder (version Jul 17 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -263,6 +263,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
bMainSizer->Fit( this ); bMainSizer->Fit( this );
// Connect Events // Connect Events
m_OptionPartsLocked->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateInterchangeableUnits ), NULL, this );
m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this ); m_ButtonCopyDoc->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
m_buttonBrowseDocFiles->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this ); m_buttonBrowseDocFiles->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
m_ButtonAddeAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this ); m_ButtonAddeAlias->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );
@ -279,6 +280,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx
DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE() DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE()
{ {
// Disconnect Events // Disconnect Events
m_OptionPartsLocked->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateInterchangeableUnits ), NULL, this );
m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this ); m_ButtonCopyDoc->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::CopyDocFromRootToAlias ), NULL, this );
m_buttonBrowseDocFiles->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this ); m_buttonBrowseDocFiles->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::BrowseAndSelectDocFile ), NULL, this );
m_ButtonAddeAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this ); m_ButtonAddeAlias->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::AddAliasOfPart ), NULL, this );

View File

@ -1343,7 +1343,7 @@
<event name="OnRightUp"></event> <event name="OnRightUp"></event>
<event name="OnSetFocus"></event> <event name="OnSetFocus"></event>
<event name="OnSize"></event> <event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI">OnUpdateInterchangeableUnits</event>
</object> </object>
</object> </object>
</object> </object>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 28 2015) // C++ code generated with wxFormBuilder (version Jul 17 2016)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
@ -96,6 +96,7 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM
wxButton* m_stdSizerButtonCancel; wxButton* m_stdSizerButtonCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnUpdateInterchangeableUnits( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void CopyDocFromRootToAlias( wxCommandEvent& event ) { event.Skip(); } virtual void CopyDocFromRootToAlias( wxCommandEvent& event ) { event.Skip(); }
virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); } virtual void BrowseAndSelectDocFile( wxCommandEvent& event ) { event.Skip(); }
virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); } virtual void AddAliasOfPart( wxCommandEvent& event ) { event.Skip(); }