MCPcopy Create free account
hub / github.com/audacity/audacity / Validate

Method Validate

src/widgets/valnum.cpp:93–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93bool NumValidatorBase::Validate(wxWindow *parent)
94{
95 // If window is disabled, simply return
96 if ( !m_validatorWindow->IsEnabled() )
97 return true;
98
99 TranslatableString errmsg;
100 bool res = DoValidateNumber(&errmsg);
101
102 if ( !res )
103 {
104 AudacityMessageBox(
105 errmsg,
106 XO("Validation error"),
107 wxOK | wxICON_ERROR,
108 parent);
109 wxTextEntry *te = GetTextEntry();
110 if ( te )
111 {
112 te->SelectAll();
113 m_validatorWindow->SetFocus();
114 }
115 return false;
116 }
117
118 return true;
119}
120
121void
122NumValidatorBase::GetCurrentValueAndInsertionPoint(wxString& val,

Callers

nothing calls this directly

Calls 4

AudacityMessageBoxFunction · 0.85
SelectAllMethod · 0.80
IsEnabledMethod · 0.45
SetFocusMethod · 0.45

Tested by

no test coverage detected