Enhancement in eeschema: Footprint field immediately updated after footprint picking (from footprint viewer) in the eeschema LIB_PART or component text field properties editors

This commit is contained in:
Dick Hollenbeck 2016-05-17 20:02:49 +02:00 committed by jean-pierre charras
parent 620ccc5483
commit daa0d391de
2 changed files with 21 additions and 8 deletions

View File

@ -106,7 +106,12 @@ private:
void copyPanelToOptions();
void setRowItem( int aFieldNdx, const SCH_FIELD& aField );
void setRowItem( int aFieldNdx, const wxString& aName, const wxString& aValue );
void setRowItem( int aFieldNdx, const SCH_FIELD& aField )
{
setRowItem( aFieldNdx, aField.GetName( false ), aField.GetText() );
}
// event handlers
void OnCloseDialog( wxCloseEvent& event );
@ -540,6 +545,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler( wxCommandEvent& even
{
// DBG( printf( "%s: %s\n", __func__, TO_UTF8( fpid ) ); )
fieldValueTextCtrl->SetValue( fpid );
setRowItem( fieldNdx, m_FieldsBuf[fieldNdx].GetName( false ), fpid );
}
frame->Destroy();
@ -765,7 +772,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
}
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const SCH_FIELD& aField )
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const wxString& aName, const wxString& aValue )
{
wxASSERT( aFieldNdx >= 0 );
@ -779,8 +786,8 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const SCH_FI
fieldListCtrl->SetItem( ndx, 1, wxEmptyString );
}
fieldListCtrl->SetItem( aFieldNdx, 0, aField.GetName( false ) );
fieldListCtrl->SetItem( aFieldNdx, 1, aField.GetText() );
fieldListCtrl->SetItem( aFieldNdx, 0, aName );
fieldListCtrl->SetItem( aFieldNdx, 1, aValue );
// recompute the column widths here, after setting texts
fieldListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );

View File

@ -113,7 +113,12 @@ private:
* bad data into a field, and this value can be used to deny a row change.
*/
bool copyPanelToSelectedField();
void setRowItem( int aFieldNdx, const LIB_FIELD& aField );
void setRowItem( int aFieldNdx, const wxString& aName, const wxString& aValue );
void setRowItem( int aFieldNdx, const LIB_FIELD& aField )
{
setRowItem( aFieldNdx, aField.GetName(), aField.GetText() );
}
/**
* Function updateDisplay
@ -408,6 +413,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler( wxCommandEvent& even
if( frame->ShowModal( &fpid, this ) )
{
fieldValueTextCtrl->SetValue( fpid );
setRowItem( fieldNdx, m_FieldsBuf[fieldNdx].GetName( false ), fpid );
}
frame->Destroy();
@ -576,7 +582,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers()
}
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const LIB_FIELD& aField )
void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const wxString& aName, const wxString& aValue )
{
wxASSERT( aFieldNdx >= 0 );
@ -590,8 +596,8 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::setRowItem( int aFieldNdx, const LIB_FI
fieldListCtrl->SetItem( ndx, COLUMN_TEXT, wxEmptyString );
}
fieldListCtrl->SetItem( aFieldNdx, COLUMN_FIELD_NAME, aField.GetName() );
fieldListCtrl->SetItem( aFieldNdx, COLUMN_TEXT, aField.GetText() );
fieldListCtrl->SetItem( aFieldNdx, COLUMN_FIELD_NAME, aName );
fieldListCtrl->SetItem( aFieldNdx, COLUMN_TEXT, aValue );
// recompute the column widths here, after setting texts
fieldListCtrl->SetColumnWidth( COLUMN_FIELD_NAME, wxLIST_AUTOSIZE );