Move value property to PCB_FOOTPRINT_FIELD_PROPERTY.

(Also reworks things a little to give the fields a
more expected order.)
This commit is contained in:
Jeff Young
2026-02-20 15:22:31 +00:00
parent 366df7bc32
commit 7b7fc35c9c
3 changed files with 30 additions and 18 deletions
+8
View File
@@ -140,6 +140,14 @@ public:
*/
PROPERTY_BASE& AddProperty( PROPERTY_BASE* aProperty, const wxString& aGroup = wxEmptyString );
/**
* Replace an existing property. This is used to modify the implementation of a property without
* moving it in the display order.
* @param aProperty is the property to register.
* @param aGroup is an optional grouping key for the property
*/
PROPERTY_BASE& ReplaceProperty( PROPERTY_BASE* aProperty, const wxString& aGroup );
/**
* Replace an existing property for a specific type.
*
+1 -18
View File
@@ -4809,25 +4809,8 @@ static struct FOOTPRINT_DESC
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Reference" ),
&FOOTPRINT::SetReference, &FOOTPRINT::GetReferenceAsString ),
groupFields );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Value" ),
&FOOTPRINT::SetValue, &FOOTPRINT::GetValueAsString ),
groupFields );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Library Link" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetFPIDAsString ),
groupFields );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Library Description" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetLibDescription ),
groupFields );
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Keywords" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetKeywords ),
groupFields );
// Note: Also used by DRC engine
propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Component Class" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetComponentClassAsString ),
groupFields )
.SetIsHiddenFromLibraryEditors();
// Remaining fields are variant-specific, and so are added in PCB_PROPERTIES_PANEL::rebuildProperties().
const wxString groupAttributes = _HKI( "Attributes" );
+21
View File
@@ -399,6 +399,11 @@ void PCB_PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
const wxString groupFields = _HKI( "Fields" );
// Make sure value comes immediately after reference. (Reference is invariant, so was added by
// FOOTPRINT_DESC(). We *could* still add it here, but then the whole Fields section comes at
// the end, which isn't ideal.)
m_propMgr.AddProperty( new PCB_FOOTPRINT_FIELD_PROPERTY( _HKI( "Value" ) ), groupFields );
for( const wxString& name : m_currentFieldNames )
{
if( !m_propMgr.GetProperty( TYPE_HASH( FOOTPRINT ), name ) )
@@ -411,6 +416,22 @@ void PCB_PROPERTIES_PANEL::rebuildProperties( const SELECTION& aSelection )
}
}
m_propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Library Link" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetFPIDAsString ),
groupFields );
m_propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Library Description" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetLibDescription ),
groupFields );
m_propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Keywords" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetKeywords ),
groupFields );
// Note: Also used by DRC engine
m_propMgr.AddProperty( new PROPERTY<FOOTPRINT, wxString>( _HKI( "Component Class" ),
NO_SETTER( FOOTPRINT, wxString ), &FOOTPRINT::GetComponentClassAsString ),
groupFields )
.SetIsHiddenFromLibraryEditors();
PROPERTIES_PANEL::rebuildProperties( aSelection );
}