diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index 9e73e7044b..6681ee89a6 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -91,6 +91,7 @@ private: void OnSizeGrid( wxSizeEvent& event ) override; void OnGridCellChanging( wxGridEvent& event ); void OnUpdateUI( wxUpdateUIEvent& event ) override; + void OnCancelButtonClick( wxCommandEvent& event ) override; void OnInitDlg( wxInitDialogEvent& event ) override { @@ -346,6 +347,14 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnEditSpiceModel( wxCommandEvent& event } +void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::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. + EndQuasiModal( wxID_CANCEL ); +} + + bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate() { wxString msg; diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic_base.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic_base.cpp index 200850f7fc..c45f513e77 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic_base.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic_base.cpp @@ -56,12 +56,12 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE m_grid->SetColLabelValue( 8, _("Orientation") ); m_grid->SetColLabelValue( 9, _("X Position") ); m_grid->SetColLabelValue( 10, _("Y Position") ); - m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + m_grid->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); // Rows m_grid->EnableDragRowSize( true ); m_grid->SetRowLabelSize( 0 ); - m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + m_grid->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); // Label Appearance @@ -251,6 +251,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE m_updateFieldValues->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this ); m_buttonBrowseLibrary->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this ); m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this ); + m_stdDialogButtonSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnCancelButtonClick ), NULL, this ); } DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE() @@ -266,5 +267,6 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BAS m_updateFieldValues->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this ); m_buttonBrowseLibrary->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this ); m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this ); + m_stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnCancelButtonClick ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic_base.fbp b/eeschema/dialogs/dialog_edit_component_in_schematic_base.fbp index 80e47529b5..98b2e81b0c 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic_base.fbp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic_base.fbp @@ -1,6 +1,6 @@ - + ; C++ @@ -16,9 +16,9 @@ none 1 dialog_edit_component_in_schematic_base - + . - + 1 1 1 @@ -29,67 +29,67 @@ 0 wxAUI_MGR_DEFAULT - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE - + -1,-1 wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Symbol Properties - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + OnInitDlg - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + OnUpdateUI - + mainSizer wxVERTICAL none @@ -100,12 +100,12 @@ wxID_ANY Fields - + sbFields wxVERTICAL 1 none - + 5 wxEXPAND|wxBOTTOM @@ -115,20 +115,20 @@ 1 1 1 - - - - + + + + 0 0 - - - + + + 1 - - + + wxALIGN_LEFT - + wxALIGN_TOP 0 1 @@ -138,7 +138,7 @@ wxALIGN_CENTER 11 72,120,48,72,72,48,48,84,84,84,84 - + 1 0 Dock @@ -150,103 +150,103 @@ 1 1 1 - + 1 - - + + 1 0 0 wxID_ANY - - - + + + 0 0 - + 0 - - + + 0 -1,180 1 m_grid 1 - - + + protected 1 - + Resizable wxALIGN_CENTER 0 - + wxALIGN_CENTER - + 4 1 - + WX_GRID; widgets/wx_grid.h; forward_declare 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnSizeGrid - + @@ -254,7 +254,7 @@ wxEXPAND 0 - + bButtonSize wxHORIZONTAL none @@ -267,88 +267,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Add Field - + 0 - - + + 0 30,30 1 m_bpAdd 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 Add field - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnAddField - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -360,88 +360,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Move Up - + 0 - - + + 0 30,30 1 m_bpMoveUp 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 Move up - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnMoveUp - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -453,88 +453,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Move Down - + 0 - - + + 0 30,30 1 m_bpMoveDown 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 Move down - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnMoveDown - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -556,88 +556,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Delete Field - + 0 - - + + 0 30,30 1 m_bpDelete 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 Delete field - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnDeleteField - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -659,17 +659,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -677,65 +677,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Update Fields from Library... - + 0 - - + + 0 - + 1 m_updateFieldValues 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Sets fields to the original library values - + wxFILTER_NONE wxDefaultValidator - - - - + + + + UpdateFieldsFromLibrary - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -747,7 +747,7 @@ wxEXPAND|wxTOP|wxRIGHT 0 - + lowerSizer wxHORIZONTAL none @@ -758,12 +758,12 @@ wxID_ANY Symbol - + sbSizerLibraryReference wxVERTICAL 1 none - + 5 wxEXPAND @@ -772,9 +772,9 @@ 2 wxBOTH 1 - + 0 - + fgSizer1 wxFLEX_GROWMODE_SPECIFIED none @@ -789,78 +789,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Library Reference: - + 0 - - + + 0 - + 1 m_staticText3 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -868,7 +868,7 @@ wxEXPAND|wxRIGHT 1 - + bLibraryReferenceSizer wxHORIZONTAL none @@ -881,86 +881,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 m_libraryNameTextCtrl 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Name of the symbol in the library to which this symbol is linked - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -972,88 +972,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Browse Library - + 0 - - + + 0 30,29 1 m_buttonBrowseLibrary 1 - - + + protected 1 - + Resizable - + 1 - - + + ; forward_declare 0 Browse library - + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnBrowseLibrary - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1067,78 +1067,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Unit: - + 0 - - + + 0 - + 1 m_unitLabel 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1150,83 +1150,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 - + 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 100,-1 1 m_unitChoice 1 - - + + protected 1 - + Resizable 0 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1248,83 +1248,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Alternate symbol (DeMorgan) - + 0 - - + + 0 - + 1 m_cbAlternateSymbol 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Use the alternate shape of this symbol. For gates, this is the "De Morgan" conversion - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1340,85 +1340,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "0" "+90" "+180" "-90" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Orientation 1 - + 0 - - + + 0 - + 1 m_rbOrientation 1 - - + + protected 1 - + Resizable 0 1 - + wxRA_SPECIFY_COLS - + 0 Select if the symbol is to be rotated when drawn - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1430,85 +1430,85 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 "Default" "Mirror around X axis" "Mirror around Y axis" 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Aspect 1 - + 0 - - + + 0 - + 1 m_rbMirror 1 - - + + protected 1 - + Resizable 1 1 - + wxRA_SPECIFY_COLS - + 0 Pick the graphical transformation to be used when displaying the symbol - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1522,76 +1522,76 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 m_staticline1 1 - - + + protected 1 - + Resizable 1 - + wxLI_HORIZONTAL ; forward_declare 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1599,7 +1599,7 @@ wxEXPAND 0 - + bSizer101 wxHORIZONTAL none @@ -1608,7 +1608,7 @@ wxEXPAND|wxRIGHT|wxLEFT 0 - + bSizer11 wxHORIZONTAL none @@ -1621,78 +1621,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Unique ID: - + 0 - - + + 0 - + 1 timeStampLabel 1 - - + + none 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1704,86 +1704,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 m_textCtrlTimeStamp 1 - - + + protected 1 - + Resizable 1 - + wxTE_READONLY - + 0 Unique ID that identifies the symbol - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1807,17 +1807,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -1825,65 +1825,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Edit Spice Model... - + 0 - - + + 0 - + 1 m_spiceFieldsButton 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + OnEditSpiceModel - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1909,17 +1909,17 @@ 1 0 0 - + m_stdDialogButtonSizer protected - - - - - - - - + + OnCancelButtonClick + + + + + + diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic_base.h b/eeschema/dialogs/dialog_edit_component_in_schematic_base.h index f8d6370d22..1b2e4d47ea 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic_base.h +++ b/eeschema/dialogs/dialog_edit_component_in_schematic_base.h @@ -78,6 +78,7 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE : public DIALOG_SHIM virtual void UpdateFieldsFromLibrary( wxCommandEvent& event ) { event.Skip(); } virtual void OnBrowseLibrary( wxCommandEvent& event ) { event.Skip(); } virtual void OnEditSpiceModel( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); } public: