Commit 79472a68 authored by charras's avatar charras
Browse files

eeschema: minor changes in field edition

parent 598cc337
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line

#include <wx/checklst.h>
#include <wx/tooltip.h>
#include <algorithm>

#include "fctsys.h"
#include "gr_basic.h"
@@ -155,7 +156,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
        }
    }

    // For components with multiple shames (De Morgan representation) Set the selected shape:
    // For components with multiple shapes (De Morgan representation) Set the selected shape:
    if( convertCheckBox->IsEnabled() )
    {
        m_Cmp->m_Convert = convertCheckBox->GetValue() ? 2 : 1;
@@ -488,6 +489,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
    // if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable editing
    fieldNameTextCtrl->Enable(  fieldNdx >= FIELD1 );
    fieldNameTextCtrl->SetEditable( fieldNdx >= FIELD1 );
    moveUpButton->Enable( fieldNdx >= FIELD1 );   // disable move up button for non moveable fields
    // if fieldNdx == REFERENCE, VALUE, then disable delete button
    deleteFieldButton->Enable( fieldNdx > VALUE );

    fieldValueTextCtrl->SetValue( field.m_Text );

@@ -549,6 +553,11 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()


    field.m_Name = fieldNameTextCtrl->GetValue();
    /* Void fields texts for REFERENCE and VALUE (value is the name of the compinent in lib ! ) are not allowed
     * change them only for a new non void value
     * When woid, usually netlists are broken
     */
    if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
        field.m_Text = fieldValueTextCtrl->GetValue();

    setRowItem( fieldNdx, field );  // update fieldListCtrl
+5 −6
Original line number Diff line number Diff line
@@ -614,13 +614,12 @@ bool DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copyPanelToSelectedField()

    rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );

    /* Void fields for REFERENCE and VALUE are not allowed
     * change therm only for a new non void value
    /* Void fields texts for REFERENCE and VALUE (value is the name of the compinent in lib ! ) are not allowed
     * change them only for a new non void value
     */
    if( !fieldValueTextCtrl->GetValue().IsEmpty() )
    if( !fieldValueTextCtrl->GetValue().IsEmpty() || fieldNdx > VALUE )
        field.m_Text = fieldValueTextCtrl->GetValue();

    if( !fieldNameTextCtrl->GetValue().IsEmpty() )
    field.m_Name = fieldNameTextCtrl->GetValue();

    setRowItem( fieldNdx, field );  // update fieldListCtrl