KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_FIELD_VALIDATOR Class Reference

A text control validator used for validating the text allowed in library and schematic symbol fields. More...

#include <sch_validators.h>

Inheritance diagram for SCH_FIELD_VALIDATOR:

Public Member Functions

 SCH_FIELD_VALIDATOR (bool aIsLibEditor, int aFieldId, wxString *aValue=nullptr)
 
 SCH_FIELD_VALIDATOR (const SCH_FIELD_VALIDATOR &aValidator)
 
virtual wxObject * Clone () const override
 
virtual bool Validate (wxWindow *aParent) override
 Override the default Validate() function provided by wxTextValidator to provide better error messages. More...
 

Private Attributes

int m_fieldId
 
bool m_isLibEditor
 

Detailed Description

A text control validator used for validating the text allowed in library and schematic symbol fields.

  • The reference field does not accept spaces.
  • The value field does not accept spaces in the symbol library editor because in symbol libraries, the value field is the symbol name in the library.

Definition at line 53 of file sch_validators.h.

Constructor & Destructor Documentation

◆ SCH_FIELD_VALIDATOR() [1/2]

SCH_FIELD_VALIDATOR::SCH_FIELD_VALIDATOR ( bool  aIsLibEditor,
int  aFieldId,
wxString *  aValue = nullptr 
)

Definition at line 39 of file sch_validators.cpp.

References m_fieldId, m_isLibEditor, REFERENCE_FIELD, SHEETFILENAME_V, and SHEETNAME_V.

◆ SCH_FIELD_VALIDATOR() [2/2]

SCH_FIELD_VALIDATOR::SCH_FIELD_VALIDATOR ( const SCH_FIELD_VALIDATOR aValidator)

Definition at line 73 of file sch_validators.cpp.

References m_fieldId, and m_isLibEditor.

Member Function Documentation

◆ Clone()

virtual wxObject * SCH_FIELD_VALIDATOR::Clone ( ) const
inlineoverridevirtual

Definition at line 60 of file sch_validators.h.

◆ Validate()

bool SCH_FIELD_VALIDATOR::Validate ( wxWindow *  aParent)
overridevirtual

Override the default Validate() function provided by wxTextValidator to provide better error messages.

Parameters
aParentis the parent window of the error message dialog.
Returns
true if the text in the control is valid otherwise false.

Definition at line 81 of file sch_validators.cpp.

References _, DATASHEET_FIELD, FOOTPRINT_FIELD, m_fieldId, REFERENCE_FIELD, SHEETFILENAME_V, SHEETNAME_V, text, and VALUE_FIELD.

Member Data Documentation

◆ m_fieldId

int SCH_FIELD_VALIDATOR::m_fieldId
private

Definition at line 72 of file sch_validators.h.

Referenced by SCH_FIELD_VALIDATOR(), and Validate().

◆ m_isLibEditor

bool SCH_FIELD_VALIDATOR::m_isLibEditor
private

Definition at line 73 of file sch_validators.h.

Referenced by SCH_FIELD_VALIDATOR().


The documentation for this class was generated from the following files: