diff --git a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.cpp b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.cpp index 132382639c..0e99d0a59f 100644 --- a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.cpp +++ b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.cpp @@ -128,3 +128,12 @@ void DIALOG_DIELECTRIC_MATERIAL::onListItemSelected( wxListEvent& event ) m_tcEpsilonR->SetValue( m_materialList.GetSubstrate( idx )->FormatEpsilonR() ); m_tcLossTg->SetValue( m_materialList.GetSubstrate( idx )->FormatLossTangent() ); } + + +void DIALOG_DIELECTRIC_MATERIAL::onListKeyDown( wxListEvent& event ) +{ + int idx = event.GetIndex(); + + if( idx > 0 ) + m_lcMaterials->DeleteItem( idx ); +} diff --git a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.h b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.h index abf8708105..dcba0cf557 100644 --- a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.h +++ b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager.h @@ -43,9 +43,10 @@ public: DIELECTRIC_SUBSTRATE GetSelectedSubstrate(); private: - void onListItemSelected( wxListEvent& event ) override; - bool TransferDataFromWindow() override; - bool TransferDataToWindow() override; + void onListKeyDown( wxListEvent& event ) override; + void onListItemSelected( wxListEvent& event ) override; + bool TransferDataFromWindow() override; + bool TransferDataToWindow() override; void initMaterialList(); // Fills the dialog with available materials diff --git a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.cpp b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.cpp index d141d127e8..c6ffece4ca 100644 --- a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.cpp +++ b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -85,11 +85,13 @@ DIALOG_DIELECTRIC_MATERIAL_BASE::DIALOG_DIELECTRIC_MATERIAL_BASE( wxWindow* pare // Connect Events m_lcMaterials->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListItemSelected ), NULL, this ); + m_lcMaterials->Connect( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListKeyDown ), NULL, this ); } DIALOG_DIELECTRIC_MATERIAL_BASE::~DIALOG_DIELECTRIC_MATERIAL_BASE() { // Disconnect Events m_lcMaterials->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListItemSelected ), NULL, this ); + m_lcMaterials->Disconnect( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListKeyDown ), NULL, this ); } diff --git a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.fbp b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.fbp index 89902f0e2c..fe14da2a15 100644 --- a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.fbp +++ b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.fbp @@ -1,624 +1,634 @@ - + - - - ; - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - connect - dialog_dielectric_list_manager_base - 1000 - none - - - 1 - DialogDielectricListManager - - . - - 1 - 1 - 1 - 1 - UI - 0 - 0 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - + + + ; + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_dielectric_list_manager_base + 1000 + none + + + 1 + DialogDielectricListManager + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 0 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_DIELECTRIC_MATERIAL_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h; forward_declare + Dielectric Material Characteristics + + 0 + + + + + + bSizerMain + wxVERTICAL + none + + 10 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 1 + - DIALOG_DIELECTRIC_MATERIAL_BASE - - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h; forward_declare - Dielectric Material Characteristics - - 0 - - - - + bSizerUpper + wxVERTICAL + none + + 5 + wxEXPAND + 0 + - bSizerMain - wxVERTICAL + bSizerNewItem + wxHORIZONTAL none - - 10 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 1 - + + 5 + + 1 + + 3 + wxBOTH + 0 + + 5 + + fgSizerNewDielectric + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 0 + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Name: + 0 + + 0 + + + 0 - bSizerUpper - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - - bSizerNewItem - wxHORIZONTAL - none - - 5 - - 1 - - 3 - wxBOTH - 0 - - 5 - - fgSizerNewDielectric - wxFLEX_GROWMODE_SPECIFIED - none - 2 - 0 - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Name: - 0 - - 0 - - - 0 - - 1 - m_staticTexMaterial - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Epsilon R: - 0 - - 0 - - - 0 - - 1 - m_staticTextEpsilonR - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Loss Tan: - 0 - - 0 - - - 0 - - 1 - m_staticTextLossTg - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - 150,-1 - 1 - m_tcMaterial - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_tcEpsilonR - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - - 1 - m_tcLossTg - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Common materials: - 0 - - 0 - - - 0 - - 1 - m_staticText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_lcMaterials - 1 - - - protected - 1 - - Resizable - 1 - - wxLC_REPORT|wxLC_SINGLE_SEL - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onListItemSelected - - - - - - 5 - wxBOTTOM|wxEXPAND|wxTOP - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer + 1 + m_staticTexMaterial + 1 + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Epsilon R: + 0 + + 0 + + + 0 + + 1 + m_staticTextEpsilonR + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Loss Tan: + 0 + + 0 + + + 0 + + 1 + m_staticTextLossTg + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + 150,-1 + 1 + m_tcMaterial + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_tcEpsilonR + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + m_tcLossTg + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Common materials: + 0 + + 0 + + + 0 + + 1 + m_staticText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_lcMaterials + 1 + + + protected + 1 + + Resizable + 1 + + wxLC_REPORT|wxLC_SINGLE_SEL + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onListItemSelected + onListKeyDown + + + + + 5 + wxBOTTOM|wxEXPAND|wxTOP + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + diff --git a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.h b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.h index 3adc5a7fa5..ea7ce67acd 100644 --- a/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.h +++ b/pcbnew/board_stackup_manager/dialog_dielectric_list_manager_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -48,6 +48,7 @@ class DIALOG_DIELECTRIC_MATERIAL_BASE : public DIALOG_SHIM // Virtual event handlers, override them in your derived class virtual void onListItemSelected( wxListEvent& event ) { event.Skip(); } + virtual void onListKeyDown( wxListEvent& event ) { event.Skip(); } public: