DIALOG_EDIT_ONE_FIELD: use a SCH_FIELD_VALIDATOR for mandatory fields.
These fields do not accept some chars, and must be filtered.
This commit is contained in:
parent
a67bf00b9e
commit
51f40a3f2b
|
@ -87,7 +87,13 @@ void DIALOG_EDIT_ONE_FIELD::init()
|
|||
m_CommonConvert->Show( false );
|
||||
m_CommonUnit->Show( false );
|
||||
|
||||
if( !isSymbolEditor && ( m_fieldId == REFERENCE_FIELD || m_fieldId == VALUE_FIELD ) )
|
||||
// Predefined fields cannot contain some chars, or cannot be empty,
|
||||
// and need a SCH_FIELD_VALIDATOR (m_StyledTextCtrl cannot use a SCH_FIELD_VALIDATOR).
|
||||
bool use_validator = m_fieldId == REFERENCE_FIELD
|
||||
|| m_fieldId == VALUE_FIELD
|
||||
|| m_fieldId == FOOTPRINT_FIELD
|
||||
|| m_fieldId == DATASHEET_FIELD;
|
||||
if( use_validator )
|
||||
{
|
||||
m_StyledTextCtrl->Show( false );
|
||||
SetInitialFocus( m_TextCtrl );
|
||||
|
|
Loading…
Reference in New Issue