Added a check for the correctness of the entered characters in numerical fields.

This commit is contained in:
YuSanka 2018-06-14 23:56:44 +02:00
parent a0090fccb5
commit 942a3340aa

View File

@ -105,7 +105,11 @@ namespace Slic3r { namespace GUI {
break;
}
double val;
str.ToCDouble(&val);
if(!str.ToCDouble(&val))
{
show_error(m_parent, _(L("Input value contains incorrect symbol(s).\nUse, please, only digits")));
set_value(double_to_string(val), true);
}
if (m_opt.min > val || val > m_opt.max)
{
show_error(m_parent, _(L("Input value is out of range")));