Fp editor, DIALOG_FOOTPRINT_FP_EDITOR: fix a very annoying issue: the value field was copuled to the fp name.

Unlike schematic symbols, the value field and the footprint name are 2 different fields.
So coupling these fields in the DIALOG_FOOTPRINT_FP_EDITOR dialog created serious issues.

Fixes: lp:1846533
https://bugs.launchpad.net/kicad/+bug/1846533
This commit is contained in:
jean-pierre charras 2019-10-09 18:53:41 +02:00
parent c7d636d560
commit 89e9857f3d
1 changed files with 3 additions and 31 deletions

View File

@ -679,26 +679,7 @@ static bool footprintIsFromBoard( MODULE* aFootprint )
void DIALOG_FOOTPRINT_FP_EDITOR::OnGridCellChanging( wxGridEvent& event )
{
if( event.GetRow() == 1 && event.GetCol() == TMC_TEXT )
{
if( !checkFootprintName( event.GetString() ) )
{
event.Veto();
if( m_NoteBook->GetSelection() != 0 )
m_NoteBook->SetSelection( 0 );
m_delayedFocusGrid = m_itemsGrid;
m_delayedFocusRow = event.GetRow();
m_delayedFocusColumn = event.GetCol();
m_delayedFocusPage = 0;
}
else if( !footprintIsFromBoard( m_footprint ) )
{
// Keep Name and Value of footprints in library in sync
m_FootprintNameCtrl->ChangeValue( event.GetString() );
}
}
// Currently: nothing to do
}
@ -706,8 +687,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnFootprintNameText( wxCommandEvent& event )
{
if( !footprintIsFromBoard( m_footprint ) )
{
// Keep Name and Value of footprints in library in sync
m_itemsGrid->SetCellValue( 1, TMC_TEXT, m_FootprintNameCtrl->GetValue() );
// Currently: nothing to do
}
}
@ -807,15 +787,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnUpdateUI( wxUpdateUIEvent& event )
if( m_itemsGrid->IsCellEditControlShown() )
{
int row = m_itemsGrid->GetGridCursorRow();
int col = m_itemsGrid->GetGridCursorCol();
if( row == 1 && col == TMC_TEXT )
{
wxGridCellEditor* editor = m_itemsGrid->GetCellEditor( row, col );
m_FootprintNameCtrl->ChangeValue( editor->GetValue() );
editor->DecRef();
}
// Currently: nonthing to do
}
// Handle a delayed focus. The delay allows us to: