Fixed and improved wxIntProperty's min/max validation failure message

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2010-07-02 14:24:45 +00:00
parent afc1f37c65
commit 3217f79df1

View File

@ -288,9 +288,17 @@ bool wxIntProperty::DoValidation( const wxPGProperty* property, wxLongLong_t& va
if ( value < min )
{
if ( mode == wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE )
pValidationInfo->SetFailureMessage(
wxString::Format(_("Value must be %lld or higher"),min)
);
{
wxString msg;
if ( !maxOk )
msg = wxString::Format(
_("Value must be %lld or higher."), min);
else
msg = wxString::Format(
_("Value must be between %lld and %lld."),
min, max);
pValidationInfo->SetFailureMessage(msg);
}
else if ( mode == wxPG_PROPERTY_VALIDATION_SATURATE )
value = min;
else
@ -304,9 +312,17 @@ bool wxIntProperty::DoValidation( const wxPGProperty* property, wxLongLong_t& va
if ( value > max )
{
if ( mode == wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE )
pValidationInfo->SetFailureMessage(
wxString::Format(_("Value must be %lld or higher"),min)
);
{
wxString msg;
if ( !minOk )
msg = wxString::Format(
_("Value must be %lld or lower."), max);
else
msg = wxString::Format(
_("Value must be between %lld and %lld."),
min, max);
pValidationInfo->SetFailureMessage(msg);
}
else if ( mode == wxPG_PROPERTY_VALIDATION_SATURATE )
value = max;
else