From 942a3340aae6f71943691beb0ea042d1c2f4d1f0 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 14 Jun 2018 23:56:44 +0200 Subject: [PATCH] Added a check for the correctness of the entered characters in numerical fields. --- xs/src/slic3r/GUI/Field.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xs/src/slic3r/GUI/Field.cpp b/xs/src/slic3r/GUI/Field.cpp index acab4f4b6..a50094662 100644 --- a/xs/src/slic3r/GUI/Field.cpp +++ b/xs/src/slic3r/GUI/Field.cpp @@ -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")));