From a425e9f70dd0c78bf01982ef49450d4fc05cc5e2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Dec 2013 00:01:47 +0000 Subject: [PATCH] Make wxTextValidator validation error messages more informative. Saying that "something is invalid" really doesn't help much at all, so try to be at least a bit more informative. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/valtext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 4a89f4f1e7..1d62a70c8a 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -162,9 +162,9 @@ bool wxTextValidator::Validate(wxWindow *parent) if ( HasFlag(wxFILTER_EMPTY) && val.empty() ) errormsg = _("Required information entry is empty."); else if ( HasFlag(wxFILTER_INCLUDE_LIST) && m_includes.Index(val) == wxNOT_FOUND ) - errormsg = wxString::Format(_("'%s' is invalid"), val); + errormsg = wxString::Format(_("'%s' is not one of the valid strings"), val); else if ( HasFlag(wxFILTER_EXCLUDE_LIST) && m_excludes.Index(val) != wxNOT_FOUND ) - errormsg = wxString::Format(_("'%s' is invalid"), val); + errormsg = wxString::Format(_("'%s' is one of the invalid strings"), val); else if ( !(errormsg = IsValid(val)).empty() ) { // NB: this format string should always contain exactly one '%s' @@ -251,9 +251,9 @@ wxString wxTextValidator::IsValid(const wxString& val) const if ( HasFlag(wxFILTER_NUMERIC) && !wxIsNumeric(val) ) return _("'%s' should be numeric."); if ( HasFlag(wxFILTER_INCLUDE_CHAR_LIST) && !ContainsOnlyIncludedCharacters(val) ) - return _("'%s' is invalid"); + return _("'%s' doesn't consist only of valid characters"); if ( HasFlag(wxFILTER_EXCLUDE_CHAR_LIST) && ContainsExcludedCharacters(val) ) - return _("'%s' is invalid"); + return _("'%s' contains illegal characters"); return wxEmptyString; }