#include <sch_validators.h>
|
wxString | IsValid (const wxString &aVal) const override |
|
Definition at line 80 of file sch_validators.h.
◆ SCH_NETNAME_VALIDATOR() [1/3]
SCH_NETNAME_VALIDATOR::SCH_NETNAME_VALIDATOR |
( |
wxString * |
aVal = nullptr | ) |
|
|
inline |
◆ SCH_NETNAME_VALIDATOR() [2/3]
SCH_NETNAME_VALIDATOR::SCH_NETNAME_VALIDATOR |
( |
bool |
aAllowSpaces | ) |
|
|
inline |
◆ SCH_NETNAME_VALIDATOR() [3/3]
◆ Clone()
virtual wxObject * SCH_NETNAME_VALIDATOR::Clone |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ IsValid()
wxString SCH_NETNAME_VALIDATOR::IsValid |
( |
const wxString & |
aVal | ) |
const |
|
overrideprotected |
- Returns
- the error message if the contents of aVal are invalid.
Definition at line 208 of file sch_validators.cpp.
209{
211
212 if( !msg.IsEmpty() )
213 return msg;
214
215
216 if( str.Length() == 1 )
217 return wxString();
218
219
220
221
223 {
225 return _(
"Signal name contains '{' and '}' but is not a valid bus name" );
226 }
227 else if( str.Contains( '[' ) || str.Contains( ']' ) )
228 {
230 return _(
"Signal name contains '[' or ']' but is not a valid bus name." );
231 }
232
233 return wxString();
234}
wxString IsValid(const wxString &aVal) const override
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.
static wxRegEx m_busGroupRegex
References _, NETNAME_VALIDATOR::IsValid(), m_busGroupRegex, NET_SETTINGS::ParseBusGroup(), and NET_SETTINGS::ParseBusVector().
◆ TransferFromWindow()
virtual bool NETNAME_VALIDATOR::TransferFromWindow |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ TransferToWindow()
virtual bool NETNAME_VALIDATOR::TransferToWindow |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ Validate()
bool NETNAME_VALIDATOR::Validate |
( |
wxWindow * |
aParent | ) |
|
|
overridevirtualinherited |
Definition at line 340 of file validators.cpp.
341{
342
343 if ( !m_validatorWindow->IsEnabled() )
344 return true;
345
346 wxTextEntry *
const text = GetTextEntry();
347
349 return false;
350
351 const wxString& errormsg =
IsValid(
text->GetValue() );
352
353 if( !errormsg.empty() )
354 {
355 m_validatorWindow->SetFocus();
356 wxMessageBox( errormsg,
_(
"Invalid signal name" ), wxOK | wxICON_EXCLAMATION, aParent );
357 return false;
358 }
359
360 return true;
361}
References _, NETNAME_VALIDATOR::IsValid(), and text.
◆ m_allowSpaces
bool NETNAME_VALIDATOR::m_allowSpaces |
|
privateinherited |
◆ m_busGroupRegex
wxRegEx SCH_NETNAME_VALIDATOR::m_busGroupRegex |
|
staticprivate |
The documentation for this class was generated from the following files: