Fix ui::edit numeric validators
This commit is contained in:
parent
8d3c227285
commit
4b7221db26
1 changed files with 2 additions and 2 deletions
|
|
@ -70,14 +70,14 @@ namespace psemek::ui
|
||||||
if (begin != end && *begin == '-')
|
if (begin != end && *begin == '-')
|
||||||
++begin;
|
++begin;
|
||||||
|
|
||||||
return std::all_of(begin, end, [](char c){ return '0' <= c && c <= '9'; });
|
return std::all_of(begin, end, [](char32_t c){ return '0' <= c && c <= '9'; });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
edit::validator_type edit::numeric_nonnegative()
|
edit::validator_type edit::numeric_nonnegative()
|
||||||
{
|
{
|
||||||
return [](std::u32string_view const str) -> bool {
|
return [](std::u32string_view const str) -> bool {
|
||||||
return std::all_of(str.begin(), str.end(), [](char c){ return '0' <= c && c <= '9'; });
|
return std::all_of(str.begin(), str.end(), [](char32_t c){ return '0' <= c && c <= '9'; });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue