Put all validator-related code inside wxUSE_VALIDATORS check

Don't bother defining a variable which is only used when
wxUSE_VALIDATORS==1 if it's 0.
This commit is contained in:
Vadim Zeitlin 2023-03-05 00:07:42 +01:00
parent fb7cde39bc
commit d40e245abb

View file

@ -258,6 +258,7 @@ private:
if ( m_combo )
{
#if wxUSE_VALIDATORS
wxString allowedChars = wxS("0123456789");
const wxChar *p2 = m_format.c_str();
@ -269,11 +270,10 @@ private:
allowedChars << (*p2++); // append char
}
#if wxUSE_VALIDATORS
wxTextValidator tv(wxFILTER_INCLUDE_CHAR_LIST);
tv.SetCharIncludes(allowedChars);
m_combo->SetValidator(tv);
#endif
#endif // wxUSE_VALIDATORS
if ( GetDate().IsValid() )
m_combo->SetText(GetDate().Format(m_format));