Disallow '/' in labels.

Fixes: lp:1749232
* https://bugs.launchpad.net/kicad/+bug/1749232
This commit is contained in:
Jeff Young 2018-02-17 13:50:23 +00:00 committed by jean-pierre charras
parent 5c6b19c55d
commit 04d1d503ee
1 changed files with 4 additions and 3 deletions

View File

@ -181,11 +181,12 @@ void DIALOG_LABEL_EDITOR::InitDialog()
m_textLabel = m_textLabelSingleLine;
m_textLabelMultiLine->Show( false );
wxTextValidator* validator = (wxTextValidator*) m_textLabel->GetValidator();
wxArrayString excludes;
// Add invalid label characters to this list.
excludes.Add( wxT( " " ) );
validator->SetExcludes( excludes );
if( m_CurrentText->GetClass() == wxT( "SCH_LABEL" ) )
validator->SetCharExcludes( wxT( " /" ) );
else
validator->SetCharExcludes( wxT( " " ) );
}
m_textLabel->SetValue( m_CurrentText->GetText() );