Implemented a support of the coFloatsOrPercents values on settings tabs
This commit is contained in:
parent
f730fd21d4
commit
f04545f1e6
10 changed files with 95 additions and 38 deletions
|
@ -54,6 +54,7 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
|
|||
default:
|
||||
switch (opt.type) {
|
||||
case coFloatOrPercent:
|
||||
case coFloatsOrPercents:
|
||||
case coFloat:
|
||||
case coFloats:
|
||||
case coPercent:
|
||||
|
@ -867,6 +868,14 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
|
|||
ret = text_value;
|
||||
break;
|
||||
}
|
||||
case coFloatsOrPercents:{
|
||||
const auto& val = config.option<ConfigOptionFloatsOrPercents>(opt_key)->get_at(idx);
|
||||
text_value = double_to_string(val.value);
|
||||
if (val.percent)
|
||||
text_value += "%";
|
||||
ret = text_value;
|
||||
break;
|
||||
}
|
||||
case coPercent:{
|
||||
double val = config.option<ConfigOptionPercent>(opt_key)->value;
|
||||
text_value = wxString::Format(_T("%i"), int(val));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue