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

A text control validator used for validating the text allowed in fields. More...

#include <validators.h>

Inheritance diagram for FIELD_VALIDATOR:

Public Member Functions

 FIELD_VALIDATOR (int aFieldId, wxString *aValue=nullptr)
 
 FIELD_VALIDATOR (const 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.
 

Private Attributes

int m_fieldId
 

Detailed Description

A text control validator used for validating the text allowed in 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 220 of file validators.h.

Constructor & Destructor Documentation

◆ FIELD_VALIDATOR() [1/2]

FIELD_VALIDATOR::FIELD_VALIDATOR ( int  aFieldId,
wxString *  aValue = nullptr 
)

Definition at line 312 of file validators.cpp.

References m_fieldId, REFERENCE_FIELD, SHEETFILENAME_V, and SHEETNAME_V.

◆ FIELD_VALIDATOR() [2/2]

FIELD_VALIDATOR::FIELD_VALIDATOR ( const FIELD_VALIDATOR aValidator)

Definition at line 341 of file validators.cpp.

Member Function Documentation

◆ Clone()

virtual wxObject * FIELD_VALIDATOR::Clone ( ) const
inlineoverridevirtual

Definition at line 227 of file validators.h.

◆ Validate()

bool 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 347 of file 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 FIELD_VALIDATOR::m_fieldId
private

Definition at line 239 of file validators.h.

Referenced by FIELD_VALIDATOR(), and Validate().


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