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.
 
bool DoValidate (const wxString &aValue, wxWindow *aParent)
 

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 313 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 342 of file validators.cpp.

Member Function Documentation

◆ Clone()

virtual wxObject * FIELD_VALIDATOR::Clone ( ) const
inlineoverridevirtual

Definition at line 227 of file validators.h.

◆ DoValidate()

bool FIELD_VALIDATOR::DoValidate ( const wxString &  aValue,
wxWindow *  aParent 
)

◆ 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 348 of file validators.cpp.

References DoValidate(), and text.

Member Data Documentation

◆ m_fieldId

int FIELD_VALIDATOR::m_fieldId
private

Definition at line 241 of file validators.h.

Referenced by DoValidate(), and FIELD_VALIDATOR().


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