Hook up delete key in stackup materials list box
Allow the delete key to delete a material from the stackup list, since otherwise there is no way to delete materials from the list. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16854
This commit is contained in:
parent
4146a74bb7
commit
7edda82b2a
|
@ -128,3 +128,12 @@ void DIALOG_DIELECTRIC_MATERIAL::onListItemSelected( wxListEvent& event )
|
||||||
m_tcEpsilonR->SetValue( m_materialList.GetSubstrate( idx )->FormatEpsilonR() );
|
m_tcEpsilonR->SetValue( m_materialList.GetSubstrate( idx )->FormatEpsilonR() );
|
||||||
m_tcLossTg->SetValue( m_materialList.GetSubstrate( idx )->FormatLossTangent() );
|
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 );
|
||||||
|
}
|
||||||
|
|
|
@ -43,9 +43,10 @@ public:
|
||||||
DIELECTRIC_SUBSTRATE GetSelectedSubstrate();
|
DIELECTRIC_SUBSTRATE GetSelectedSubstrate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onListItemSelected( wxListEvent& event ) override;
|
void onListKeyDown( wxListEvent& event ) override;
|
||||||
bool TransferDataFromWindow() override;
|
void onListItemSelected( wxListEvent& event ) override;
|
||||||
bool TransferDataToWindow() override;
|
bool TransferDataFromWindow() override;
|
||||||
|
bool TransferDataToWindow() override;
|
||||||
|
|
||||||
void initMaterialList(); // Fills the dialog with available materials
|
void initMaterialList(); // Fills the dialog with available materials
|
||||||
|
|
||||||
|
|
|
@ -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/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -85,11 +85,13 @@ DIALOG_DIELECTRIC_MATERIAL_BASE::DIALOG_DIELECTRIC_MATERIAL_BASE( wxWindow* pare
|
||||||
|
|
||||||
// Connect Events
|
// Connect Events
|
||||||
m_lcMaterials->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListItemSelected ), NULL, this );
|
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()
|
DIALOG_DIELECTRIC_MATERIAL_BASE::~DIALOG_DIELECTRIC_MATERIAL_BASE()
|
||||||
{
|
{
|
||||||
// Disconnect Events
|
// Disconnect Events
|
||||||
m_lcMaterials->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_DIELECTRIC_MATERIAL_BASE::onListItemSelected ), NULL, this );
|
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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// 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 event handlers, override them in your derived class
|
||||||
virtual void onListItemSelected( wxListEvent& event ) { event.Skip(); }
|
virtual void onListItemSelected( wxListEvent& event ) { event.Skip(); }
|
||||||
|
virtual void onListKeyDown( wxListEvent& event ) { event.Skip(); }
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue