PCB: footprint properties dialog fields fixes
This commit is contained in:
parent
74606cda9c
commit
ad7d9ec956
|
@ -567,10 +567,14 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnAddField( wxCommandEvent& )
|
||||||
if( !m_itemsGrid->CommitPendingChanges() )
|
if( !m_itemsGrid->CommitPendingChanges() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PCB_FIELD* newField = new PCB_FIELD( m_footprint, m_fields->size() );
|
int fieldId = (int) m_fields->size();
|
||||||
|
PCB_FIELD* newField =
|
||||||
|
new PCB_FIELD( m_footprint, m_fields->size(),
|
||||||
|
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldId, DO_TRANSLATE ) );
|
||||||
|
|
||||||
newField->SetLayer( m_footprint->GetLayer() == F_Cu ? F_Fab : B_Fab );
|
|
||||||
newField->SetVisible( false );
|
newField->SetVisible( false );
|
||||||
|
newField->SetLayer( m_footprint->GetLayer() == F_Cu ? F_Fab : B_Fab );
|
||||||
|
newField->SetFPRelativePosition( { 0, 0 } );
|
||||||
newField->StyleFromSettings( m_frame->GetDesignSettings() );
|
newField->StyleFromSettings( m_frame->GetDesignSettings() );
|
||||||
|
|
||||||
m_fields->push_back( newField );
|
m_fields->push_back( newField );
|
||||||
|
|
|
@ -621,8 +621,11 @@ void DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddField( wxCommandEvent& event )
|
||||||
if( !m_itemsGrid->CommitPendingChanges() )
|
if( !m_itemsGrid->CommitPendingChanges() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int fieldId = (int) m_fields->size();
|
||||||
const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
|
const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
|
||||||
PCB_FIELD* newField = new PCB_FIELD( m_footprint, m_fields->size() );
|
PCB_FIELD* newField =
|
||||||
|
new PCB_FIELD( m_footprint, m_fields->size(),
|
||||||
|
TEMPLATE_FIELDNAME::GetDefaultFieldName( fieldId, DO_TRANSLATE ) );
|
||||||
|
|
||||||
// Set active layer if legal; otherwise copy layer from previous text item
|
// Set active layer if legal; otherwise copy layer from previous text item
|
||||||
if( LSET::AllTechMask().test( m_frame->GetActiveLayer() ) )
|
if( LSET::AllTechMask().test( m_frame->GetActiveLayer() ) )
|
||||||
|
|
|
@ -764,7 +764,7 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode )
|
||||||
PCB_FIELD* field = static_cast<PCB_FIELD*>( aBoardItem );
|
PCB_FIELD* field = static_cast<PCB_FIELD*>( aBoardItem );
|
||||||
|
|
||||||
// Only user text can be removed this way.
|
// Only user text can be removed this way.
|
||||||
wxCHECK_RET( field->IsMandatoryField(),
|
wxCHECK_RET( !field->IsMandatoryField(),
|
||||||
wxT( "Please report this bug: Invalid remove operation on required text" ) );
|
wxT( "Please report this bug: Invalid remove operation on required text" ) );
|
||||||
for( auto it = m_fields.begin(); it != m_fields.end(); ++it )
|
for( auto it = m_fields.begin(); it != m_fields.end(); ++it )
|
||||||
{
|
{
|
||||||
|
|
|
@ -157,7 +157,7 @@ wxGridCellAttr* FP_TEXT_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr:
|
||||||
switch( aCol )
|
switch( aCol )
|
||||||
{
|
{
|
||||||
case FPT_NAME:
|
case FPT_NAME:
|
||||||
if( aRow < 2 )
|
if( aRow < MANDATORY_FIELDS )
|
||||||
{
|
{
|
||||||
m_readOnlyAttr->IncRef();
|
m_readOnlyAttr->IncRef();
|
||||||
return m_readOnlyAttr;
|
return m_readOnlyAttr;
|
||||||
|
|
Loading…
Reference in New Issue