| 144 | } |
| 145 | |
| 146 | bool DoubleValidator::TransferFromWindow() { |
| 147 | auto ctrl = static_cast<wxTextCtrl *>(GetWindow()); |
| 148 | if (!Validate(ctrl)) return false; |
| 149 | auto str = from_wx(ctrl->GetValue()); |
| 150 | if (decimal_sep != '.') |
| 151 | replace(begin(str), end(str), (char)decimal_sep, '.'); |
| 152 | agi::util::try_parse(str, value); |
| 153 | return true; |
| 154 | } |
| 155 | |
| 156 | bool DoubleSpinValidator::TransferToWindow() { |
| 157 | static_cast<wxSpinCtrlDouble*>(GetWindow())->SetValue(*value); |