Don't allow range for anything but center freq

This commit is contained in:
Charles J. Cliffe 2016-08-16 00:00:54 -04:00
parent 4be9fa0538
commit 5573dce408
1 changed files with 6 additions and 1 deletions

View File

@ -204,7 +204,12 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
break;
}
std::string allowed("0123456789.MKGHZmkghz-");
std::string allowed("0123456789.MKGHZmkghz");
// Support '-' for range
if (targetMode == FDIALOG_TARGET_DEFAULT && !activeDemod && strValue.length() > 0) {
allowed.append("-");
}
if (allowed.find_first_of(c) != std::string::npos || c == WXK_DELETE || c == WXK_BACK || c == WXK_NUMPAD_DECIMAL
|| (c >= WXK_NUMPAD0 && c <= WXK_NUMPAD9)) {