From d785dae88bb389edbf49727872c06bc03b57c920 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 22 Oct 2020 10:40:54 +0100 Subject: [PATCH] DIALOG_EDIT_COMPONENT_IN_LIB -> DIALOG_LIB_SYMBOL_PROPERTIES. --- eeschema/CMakeLists.txt | 4 +- ...b.cpp => dialog_lib_symbol_properties.cpp} | 72 ++++++++++--------- ...n_lib.h => dialog_lib_symbol_properties.h} | 26 ++++--- ... => dialog_lib_symbol_properties_base.cpp} | 72 +++++++++---------- ... => dialog_lib_symbol_properties_base.fbp} | 16 +---- ....h => dialog_lib_symbol_properties_base.h} | 10 +-- eeschema/tools/lib_edit_tool.cpp | 4 +- 7 files changed, 97 insertions(+), 107 deletions(-) rename eeschema/dialogs/{dialog_edit_component_in_lib.cpp => dialog_lib_symbol_properties.cpp} (89%) rename eeschema/dialogs/{dialog_edit_component_in_lib.h => dialog_lib_symbol_properties.h} (86%) rename eeschema/dialogs/{dialog_edit_component_in_lib_base.cpp => dialog_lib_symbol_properties_base.cpp} (84%) rename eeschema/dialogs/{dialog_edit_component_in_lib_base.fbp => dialog_lib_symbol_properties_base.fbp} (99%) rename eeschema/dialogs/{dialog_edit_component_in_lib_base.h => dialog_lib_symbol_properties_base.h} (87%) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 5b4b0dc016..7700bf7129 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -56,8 +56,8 @@ set( EESCHEMA_DLGS dialogs/dialog_change_symbols.cpp dialogs/dialog_change_symbols_base.cpp dialogs/dialog_choose_component.cpp - dialogs/dialog_edit_component_in_lib.cpp - dialogs/dialog_edit_component_in_lib_base.cpp + dialogs/dialog_lib_symbol_properties.cpp + dialogs/dialog_lib_symbol_properties_base.cpp dialogs/dialog_edit_components_libid.cpp dialogs/dialog_edit_components_libid_base.cpp dialogs/dialog_edit_label.cpp diff --git a/eeschema/dialogs/dialog_edit_component_in_lib.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp similarity index 89% rename from eeschema/dialogs/dialog_edit_component_in_lib.cpp rename to eeschema/dialogs/dialog_lib_symbol_properties.cpp index 34306e98fe..c53abb116c 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -38,19 +38,19 @@ #include #endif /* KICAD_SPICE */ -#include +#include #include #include -int DIALOG_EDIT_COMPONENT_IN_LIBRARY::m_lastOpenedPage = 0; -DIALOG_EDIT_COMPONENT_IN_LIBRARY::LAST_LAYOUT - DIALOG_EDIT_COMPONENT_IN_LIBRARY::m_lastLayout = DIALOG_EDIT_COMPONENT_IN_LIBRARY::NONE; +int DIALOG_LIB_SYMBOL_PROPERTIES::m_lastOpenedPage = 0; +DIALOG_LIB_SYMBOL_PROPERTIES::LAST_LAYOUT + DIALOG_LIB_SYMBOL_PROPERTIES::m_lastLayout = DIALOG_LIB_SYMBOL_PROPERTIES::NONE; -DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* aParent, +DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES( LIB_EDIT_FRAME* aParent, LIB_PART* aLibEntry ) : - DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( aParent ), + DIALOG_LIB_SYMBOL_PROPERTIES_BASE( aParent ), m_Parent( aParent ), m_libEntry( aLibEntry ), m_pinNameOffset( aParent, m_nameOffsetLabel, m_nameOffsetCtrl, m_nameOffsetUnits, true ), @@ -94,20 +94,20 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA // wxFormBuilder doesn't include this event... m_grid->Connect( wxEVT_GRID_CELL_CHANGING, - wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ), + wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ), NULL, this ); - if( m_lastLayout != DIALOG_EDIT_COMPONENT_IN_LIBRARY::NONE ) + if( m_lastLayout != DIALOG_LIB_SYMBOL_PROPERTIES::NONE ) { - if( ( m_lastLayout == DIALOG_EDIT_COMPONENT_IN_LIBRARY::ALIAS && aLibEntry->IsRoot() ) - || ( m_lastLayout == DIALOG_EDIT_COMPONENT_IN_LIBRARY::PARENT && aLibEntry->IsAlias() ) ) + if( ( m_lastLayout == DIALOG_LIB_SYMBOL_PROPERTIES::ALIAS && aLibEntry->IsRoot() ) + || ( m_lastLayout == DIALOG_LIB_SYMBOL_PROPERTIES::PARENT && aLibEntry->IsAlias() ) ) { ResetSize(); } } - m_lastLayout = ( aLibEntry->IsAlias() ) ? DIALOG_EDIT_COMPONENT_IN_LIBRARY::ALIAS : - DIALOG_EDIT_COMPONENT_IN_LIBRARY::PARENT; + m_lastLayout = ( aLibEntry->IsAlias() ) ? DIALOG_LIB_SYMBOL_PROPERTIES::ALIAS + : DIALOG_LIB_SYMBOL_PROPERTIES::PARENT; m_grid->GetParent()->Layout(); syncControlStates( m_libEntry->IsAlias() ); @@ -117,7 +117,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRA } -DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY() +DIALOG_LIB_SYMBOL_PROPERTIES::~DIALOG_LIB_SYMBOL_PROPERTIES() { m_lastOpenedPage = m_NoteBook->GetSelection( ); @@ -128,7 +128,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY() m_grid->DestroyTable( m_fields ); m_grid->Disconnect( wxEVT_GRID_CELL_CHANGING, - wxGridEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging ), + wxGridEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging ), NULL, this ); // Delete the GRID_TRICKS. @@ -136,7 +136,7 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY::~DIALOG_EDIT_COMPONENT_IN_LIBRARY() } -bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow() +bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow() { if( !wxDialog::TransferDataToWindow() ) return false; @@ -208,7 +208,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataToWindow() } -bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::Validate() +bool DIALOG_LIB_SYMBOL_PROPERTIES::Validate() { if( !m_grid->CommitPendingChanges() ) return false; @@ -284,7 +284,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::Validate() } -bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow() +bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow() { if( !wxDialog::TransferDataFromWindow() ) return false; @@ -389,7 +389,7 @@ bool DIALOG_EDIT_COMPONENT_IN_LIBRARY::TransferDataFromWindow() } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging( wxGridEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event ) { wxGridCellEditor* editor = m_grid->GetCellEditor( event.GetRow(), event.GetCol() ); wxControl* control = editor->GetControl(); @@ -429,13 +429,13 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnGridCellChanging( wxGridEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSymbolNameText( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event ) { m_grid->SetCellValue( VALUE, FDC_VALUE, m_SymbolNameCtrl->GetValue() ); } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSymbolNameKillFocus( wxFocusEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameKillFocus( wxFocusEvent& event ) { if( !m_delayedFocusCtrl && !m_SymbolNameCtrl->GetValidator()->Validate( m_SymbolNameCtrl ) ) { @@ -447,7 +447,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSymbolNameKillFocus( wxFocusEvent& even } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddField( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField( wxCommandEvent& event ) { if( !m_grid->CommitPendingChanges() ) return; @@ -473,12 +473,14 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddField( wxCommandEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteField( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteField( wxCommandEvent& event ) { int curRow = m_grid->GetGridCursorRow(); if( curRow < 0 ) + { return; + } else if( curRow < MANDATORY_FIELDS ) { DisplayError( this, wxString::Format( _( "The first %d fields are mandatory." ), @@ -502,7 +504,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteField( wxCommandEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveUp( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnMoveUp( wxCommandEvent& event ) { if( !m_grid->CommitPendingChanges() ) return; @@ -524,7 +526,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveUp( wxCommandEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnMoveDown( wxCommandEvent& event ) { if( !m_grid->CommitPendingChanges() ) return; @@ -546,7 +548,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditSpiceModel( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditSpiceModel( wxCommandEvent& event ) { #ifdef KICAD_SPICE int diff = m_fields->size(); @@ -575,7 +577,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditSpiceModel( wxCommandEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnFilterDClick( wxMouseEvent& event) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnFilterDClick( wxMouseEvent& event) { int idx = m_FootprintFilterListBox->HitTest( event.GetPosition() ); wxCommandEvent dummy; @@ -587,7 +589,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnFilterDClick( wxMouseEvent& event) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelButtonClick( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnCancelButtonClick( wxCommandEvent& event ) { // Running the Footprint Browser gums up the works and causes the automatic cancel // stuff to no longer work. So we do it here ourselves. @@ -595,7 +597,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelButtonClick( wxCommandEvent& even } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddFootprintFilter( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnAddFootprintFilter( wxCommandEvent& event ) { wxString filterLine; WX_TEXT_ENTRY_DIALOG dlg( this, _( "Filter:" ), _( "Add Footprint Filter" ), filterLine ); @@ -613,7 +615,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnAddFootprintFilter( wxCommandEvent& eve } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteFootprintFilter( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteFootprintFilter( wxCommandEvent& event ) { int ii = m_FootprintFilterListBox->GetSelection(); @@ -629,7 +631,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnDeleteFootprintFilter( wxCommandEvent& } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditFootprintFilter( wxCommandEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnEditFootprintFilter( wxCommandEvent& event ) { int idx = m_FootprintFilterListBox->GetSelection(); @@ -645,7 +647,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditFootprintFilter( wxCommandEvent& ev } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::adjustGridColumns( int aWidth ) +void DIALOG_LIB_SYMBOL_PROPERTIES::adjustGridColumns( int aWidth ) { m_width = aWidth; @@ -663,7 +665,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::adjustGridColumns( int aWidth ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI( wxUpdateUIEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) { m_OptionPartsLocked->Enable( m_SelNumberOfUnits->GetValue() > 1 ); m_pinNameOffset.Enable( m_PinsNameInsideButt->GetValue() ); @@ -739,7 +741,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnUpdateUI( wxUpdateUIEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeGrid( wxSizeEvent& event ) +void DIALOG_LIB_SYMBOL_PROPERTIES::OnSizeGrid( wxSizeEvent& event ) { auto new_size = event.GetSize().GetX(); @@ -753,7 +755,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnSizeGrid( wxSizeEvent& event ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::syncControlStates( bool aIsAlias ) +void DIALOG_LIB_SYMBOL_PROPERTIES::syncControlStates( bool aIsAlias ) { // Remove the not wanted notebook page. // *Do not use* Hide(), it is suitable to hide a widget, @@ -774,7 +776,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::syncControlStates( bool aIsAlias ) } -void DIALOG_EDIT_COMPONENT_IN_LIBRARY::onPowerCheckBox( wxCommandEvent& aEvent ) +void DIALOG_LIB_SYMBOL_PROPERTIES::onPowerCheckBox( wxCommandEvent& aEvent ) { if( m_OptionPower->IsChecked() ) { diff --git a/eeschema/dialogs/dialog_edit_component_in_lib.h b/eeschema/dialogs/dialog_lib_symbol_properties.h similarity index 86% rename from eeschema/dialogs/dialog_edit_component_in_lib.h rename to eeschema/dialogs/dialog_lib_symbol_properties.h index 2a92b927ad..587e3f2607 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib.h +++ b/eeschema/dialogs/dialog_lib_symbol_properties.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,12 +22,12 @@ */ -#ifndef _DIALOG_EDIT_COMPONENT_IN_LIB_H_ -#define _DIALOG_EDIT_COMPONENT_IN_LIB_H_ +#ifndef DIALOG_LIB_SYMBOL_PROPERTIES_H +#define DIALOG_LIB_SYMBOL_PROPERTIES_H #include #include -#include +#include class LIB_EDIT_FRAME; @@ -35,7 +35,7 @@ class LIB_PART; class WX_GRID; -class DIALOG_EDIT_COMPONENT_IN_LIBRARY: public DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE +class DIALOG_LIB_SYMBOL_PROPERTIES: public DIALOG_LIB_SYMBOL_PROPERTIES_BASE { static int m_lastOpenedPage; // To remember the last notebook selection @@ -65,22 +65,20 @@ public: wxString m_shownColumns; int m_width; +public: + /// Constructors + DIALOG_LIB_SYMBOL_PROPERTIES( LIB_EDIT_FRAME* parent, LIB_PART* aLibEntry ); + ~DIALOG_LIB_SYMBOL_PROPERTIES(); + +protected: bool TransferDataToWindow() override; bool TransferDataFromWindow() override; bool Validate() override; -public: - /// Constructors - DIALOG_EDIT_COMPONENT_IN_LIBRARY( LIB_EDIT_FRAME* parent, LIB_PART* aLibEntry ); - ~DIALOG_EDIT_COMPONENT_IN_LIBRARY(); - -protected: virtual void onPowerCheckBox( wxCommandEvent& aEvent ) override; private: - void transferAliasDataToBuffer(); - void OnAddField( wxCommandEvent& event ) override; void OnDeleteField( wxCommandEvent& event ) override; void OnMoveUp( wxCommandEvent& event ) override; @@ -101,4 +99,4 @@ private: void syncControlStates( bool aIsAlias ); }; -#endif // _DIALOG_EDIT_COMPONENT_IN_LIB_H_ +#endif // DIALOG_LIB_SYMBOL_PROPERTIES_H diff --git a/eeschema/dialogs/dialog_edit_component_in_lib_base.cpp b/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp similarity index 84% rename from eeschema/dialogs/dialog_edit_component_in_lib_base.cpp rename to eeschema/dialogs/dialog_lib_symbol_properties_base.cpp index ea1b48dccb..cb97d84438 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib_base.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -7,11 +7,11 @@ #include "widgets/wx_grid.h" -#include "dialog_edit_component_in_lib_base.h" +#include "dialog_lib_symbol_properties_base.h" /////////////////////////////////////////////////////////////////////////// -DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -354,42 +354,42 @@ DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wx bMainSizer->Fit( this ); // Connect Events - this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateUI ) ); - m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeGrid ), NULL, this ); - m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddField ), NULL, this ); - m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveUp ), NULL, this ); - m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveDown ), NULL, this ); - m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteField ), NULL, this ); - m_SymbolNameCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameKillFocus ), NULL, this ); - m_SymbolNameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameText ), NULL, this ); - m_OptionPower->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::onPowerCheckBox ), NULL, this ); - m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnFilterDClick ), NULL, this ); - m_FootprintFilterListBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this ); - m_addFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddFootprintFilter ), NULL, this ); - m_editFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this ); - m_deleteFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteFootprintFilter ), NULL, this ); - m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditSpiceModel ), NULL, this ); - m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelButtonClick ), NULL, this ); + this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnUpdateUI ) ); + m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSizeGrid ), NULL, this ); + m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddField ), NULL, this ); + m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnMoveUp ), NULL, this ); + m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnMoveDown ), NULL, this ); + m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteField ), NULL, this ); + m_SymbolNameCtrl->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSymbolNameKillFocus ), NULL, this ); + m_SymbolNameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSymbolNameText ), NULL, this ); + m_OptionPower->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::onPowerCheckBox ), NULL, this ); + m_FootprintFilterListBox->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this ); + m_FootprintFilterListBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); + m_addFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this ); + m_editFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); + m_deleteFilterButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteFootprintFilter ), NULL, this ); + m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); + m_stdSizerButtonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); } -DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE() +DIALOG_LIB_SYMBOL_PROPERTIES_BASE::~DIALOG_LIB_SYMBOL_PROPERTIES_BASE() { // Disconnect Events - this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnUpdateUI ) ); - m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSizeGrid ), NULL, this ); - m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddField ), NULL, this ); - m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveUp ), NULL, this ); - m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnMoveDown ), NULL, this ); - m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteField ), NULL, this ); - m_SymbolNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameKillFocus ), NULL, this ); - m_SymbolNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnSymbolNameText ), NULL, this ); - m_OptionPower->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::onPowerCheckBox ), NULL, this ); - m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnFilterDClick ), NULL, this ); - m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this ); - m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnAddFootprintFilter ), NULL, this ); - m_editFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditFootprintFilter ), NULL, this ); - m_deleteFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnDeleteFootprintFilter ), NULL, this ); - m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnEditSpiceModel ), NULL, this ); - m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE::OnCancelButtonClick ), NULL, this ); + this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnUpdateUI ) ); + m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSizeGrid ), NULL, this ); + m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddField ), NULL, this ); + m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnMoveUp ), NULL, this ); + m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnMoveDown ), NULL, this ); + m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteField ), NULL, this ); + m_SymbolNameCtrl->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSymbolNameKillFocus ), NULL, this ); + m_SymbolNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnSymbolNameText ), NULL, this ); + m_OptionPower->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::onPowerCheckBox ), NULL, this ); + m_FootprintFilterListBox->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnFilterDClick ), NULL, this ); + m_FootprintFilterListBox->Disconnect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); + m_addFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnAddFootprintFilter ), NULL, this ); + m_editFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditFootprintFilter ), NULL, this ); + m_deleteFilterButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnDeleteFootprintFilter ), NULL, this ); + m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnEditSpiceModel ), NULL, this ); + m_stdSizerButtonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_SYMBOL_PROPERTIES_BASE::OnCancelButtonClick ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_edit_component_in_lib_base.fbp b/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp similarity index 99% rename from eeschema/dialogs/dialog_edit_component_in_lib_base.fbp rename to eeschema/dialogs/dialog_lib_symbol_properties_base.fbp index 89493520ef..e5276131f8 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib_base.fbp +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.fbp @@ -11,13 +11,12 @@ res UTF-8 connect - dialog_edit_component_in_lib_base + dialog_lib_symbol_properties_base 1000 none - 1 - DIALOG_EDIT_COMPONENT_IN_LIBRARY_FBP + DIALOG_LIB_SYMBOL_PROPERTIES . @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -45,7 +43,7 @@ ID_LIBEDIT_NOTEBOOK - DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE + DIALOG_LIB_SYMBOL_PROPERTIES_BASE -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER @@ -310,7 +308,6 @@ - 0 @@ -384,7 +381,6 @@ - 0 @@ -458,7 +454,6 @@ - 0 @@ -542,7 +537,6 @@ - 0 @@ -2284,7 +2278,6 @@ - 0 @@ -2358,7 +2351,6 @@ - 0 @@ -2442,7 +2434,6 @@ - 0 @@ -2546,7 +2537,6 @@ - 0 diff --git a/eeschema/dialogs/dialog_edit_component_in_lib_base.h b/eeschema/dialogs/dialog_lib_symbol_properties_base.h similarity index 87% rename from eeschema/dialogs/dialog_edit_component_in_lib_base.h rename to eeschema/dialogs/dialog_lib_symbol_properties_base.h index 9b09962aaf..73c9071d83 100644 --- a/eeschema/dialogs/dialog_edit_component_in_lib_base.h +++ b/eeschema/dialogs/dialog_lib_symbol_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -41,9 +41,9 @@ class WX_GRID; #define ID_LIBEDIT_NOTEBOOK 1000 /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE +/// Class DIALOG_LIB_SYMBOL_PROPERTIES_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM +class DIALOG_LIB_SYMBOL_PROPERTIES_BASE : public DIALOG_SHIM { private: @@ -107,8 +107,8 @@ class DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE : public DIALOG_SHIM public: - DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_EDIT_COMPONENT_IN_LIBRARY_BASE(); + DIALOG_LIB_SYMBOL_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = ID_LIBEDIT_NOTEBOOK, const wxString& title = _("Library Symbol Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_LIB_SYMBOL_PROPERTIES_BASE(); }; diff --git a/eeschema/tools/lib_edit_tool.cpp b/eeschema/tools/lib_edit_tool.cpp index 5676e15112..1d28b6a5ad 100644 --- a/eeschema/tools/lib_edit_tool.cpp +++ b/eeschema/tools/lib_edit_tool.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -541,7 +541,7 @@ void LIB_EDIT_TOOL::editSymbolProperties() m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); - DIALOG_EDIT_COMPONENT_IN_LIBRARY dlg( m_frame, part ); + DIALOG_LIB_SYMBOL_PROPERTIES dlg( m_frame, part ); // This dialog itself subsequently can invoke a KIWAY_PLAYER as a quasimodal // frame. Therefore this dialog as a modal frame parent, MUST be run under