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:
@@ -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
@@ -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" );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user