mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-06 08:36:08 +08:00
FIX: check int value invalid in Choise Field
Change-Id: I75cbe55b36dd75480903b6991f234c02ad8de5cc
This commit is contained in:
parent
09e1c0a1af
commit
62da568e0b
@ -224,9 +224,19 @@ static wxString na_value() { return _(L("N/A")); }
|
||||
void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true*/)
|
||||
{
|
||||
switch (m_opt.type) {
|
||||
case coInt:
|
||||
m_value = wxAtoi(str);
|
||||
break;
|
||||
case coInt: {
|
||||
long val = 0;
|
||||
if (!str.ToLong(&val)) {
|
||||
if (!check_value) {
|
||||
m_value.clear();
|
||||
break;
|
||||
}
|
||||
show_error(m_parent, _(L("Invalid numeric.")));
|
||||
set_value(int(val), true);
|
||||
}
|
||||
m_value = int(val);
|
||||
break;
|
||||
}
|
||||
case coPercent:
|
||||
case coPercents:
|
||||
case coFloats:
|
||||
|
Loading…
x
Reference in New Issue
Block a user