Properties: mask layer property for items that can't set it

This commit is contained in:
Jon Evans 2022-12-01 22:22:29 -05:00
parent ef3f2a8f1e
commit 73b3f28c25
2 changed files with 4 additions and 1 deletions

View File

@ -1726,6 +1726,8 @@ static struct PAD_DESC
REGISTER_TYPE( PAD ); REGISTER_TYPE( PAD );
propMgr.InheritsAfter( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) ); propMgr.InheritsAfter( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ) );
propMgr.Mask( TYPE_HASH( PAD ), TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ) );
propMgr.AddProperty( new PROPERTY<PAD, double>( _HKI( "Orientation" ), propMgr.AddProperty( new PROPERTY<PAD, double>( _HKI( "Orientation" ),
&PAD::SetOrientationDegrees, &PAD::GetOrientationDegrees, &PAD::SetOrientationDegrees, &PAD::GetOrientationDegrees,
PROPERTY_DISPLAY::PT_DEGREE ) ); PROPERTY_DISPLAY::PT_DEGREE ) );

View File

@ -1279,10 +1279,11 @@ static struct TRACK_VIA_DESC
REGISTER_TYPE( PCB_VIA ); REGISTER_TYPE( PCB_VIA );
propMgr.InheritsAfter( TYPE_HASH( PCB_VIA ), TYPE_HASH( BOARD_CONNECTED_ITEM ) ); propMgr.InheritsAfter( TYPE_HASH( PCB_VIA ), TYPE_HASH( BOARD_CONNECTED_ITEM ) );
// TODO layerset for vias?
// TODO test drill, use getdrillvalue? // TODO test drill, use getdrillvalue?
const wxString groupVia = _( "Via Properties" ); const wxString groupVia = _( "Via Properties" );
propMgr.Mask( TYPE_HASH( PCB_VIA ), TYPE_HASH( BOARD_CONNECTED_ITEM ), _HKI( "Layer" ) );
propMgr.ReplaceProperty( TYPE_HASH( PCB_TRACK ), _HKI( "Width" ), propMgr.ReplaceProperty( TYPE_HASH( PCB_TRACK ), _HKI( "Width" ),
new PROPERTY<PCB_VIA, int, PCB_TRACK>( _HKI( "Diameter" ), new PROPERTY<PCB_VIA, int, PCB_TRACK>( _HKI( "Diameter" ),
&PCB_VIA::SetWidth, &PCB_VIA::GetWidth, PROPERTY_DISPLAY::PT_SIZE ) ); &PCB_VIA::SetWidth, &PCB_VIA::GetWidth, PROPERTY_DISPLAY::PT_SIZE ) );