Update texts with %V and %R when values or references is chosen.

(This in addition to updating them when other fields is chosen.)
This commit is contained in:
Jeff Young 2018-10-16 17:46:01 +01:00
parent 51deb9d562
commit 6e3f226e45
1 changed files with 26 additions and 8 deletions

View File

@ -315,20 +315,38 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
// Go through all other module items
for( BOARD_ITEM* boardItem : module->GraphicalItems() )
{
if( m_otherFields->GetValue() && boardItem->Type() == PCB_MODULE_TEXT_T )
visitItem( commit, boardItem );
else if( m_footprintGraphics->GetValue() && boardItem->Type() == PCB_MODULE_EDGE_T )
visitItem( commit, boardItem );
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
const wxString& text = dynamic_cast<EDA_TEXT*>( boardItem )->GetText();
if( m_references->GetValue() && text == wxT( "%R" ) )
visitItem( commit, boardItem );
else if( m_values->GetValue() && text == wxT( "%V" ) )
visitItem( commit, boardItem );
else if( m_otherFields->GetValue() )
visitItem( commit, boardItem );
}
else if( boardItem->Type() == PCB_MODULE_EDGE_T )
{
if( m_footprintGraphics->GetValue() )
visitItem( commit, boardItem );
}
}
}
// Go through the PCB text & graphic items
for( BOARD_ITEM* boardItem : m_parent->GetBoard()->Drawings() )
{
if( m_boardText->GetValue() && boardItem->Type() == PCB_TEXT_T )
visitItem( commit, boardItem );
else if( m_boardGraphics->GetValue() && boardItem->Type() == PCB_LINE_T )
visitItem( commit, boardItem );
if( boardItem->Type() == PCB_TEXT_T )
{
if( m_boardText->GetValue() )
visitItem( commit, boardItem );
}
else if( boardItem->Type() == PCB_LINE_T )
{
if( m_boardGraphics->GetValue() )
visitItem( commit, boardItem );
}
}
commit.Push( "Edit text and graphics properties" );