From 1790c536efebebe79907172723a218203f01d7ec Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 20 Jul 2020 23:28:54 +0100 Subject: [PATCH] Allow user layer names to be used in DRC rules. I imagine this will also fix the property inspector, once it gets merged. --- include/property.h | 2 +- pcbnew/pcb_edit_frame.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/property.h b/include/property.h index 04cfe4b258..cfce121088 100644 --- a/include/property.h +++ b/include/property.h @@ -544,7 +544,7 @@ public: return m_default; } - const wxPGChoices& Choices() const + wxPGChoices& Choices() { return m_choices; } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 2eed0b4c2c..7401b2864d 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -467,6 +467,14 @@ void PCB_EDIT_FRAME::setupTools() void PCB_EDIT_FRAME::ReFillLayerWidget() { + ENUM_MAP& layerEnum = ENUM_MAP::Instance(); + + layerEnum.Choices().Clear(); + layerEnum.SetDefault( UNDEFINED_LAYER ); + + for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq ) + layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) ); + wxWindowUpdateLocker no_update( m_Layers ); m_Layers->ReFill();