Cleanup and fixes

This commit is contained in:
Charles J. Cliffe 2015-05-10 20:00:48 -04:00
parent fc21d96c12
commit 010481d74f
4 changed files with 13 additions and 9 deletions

View File

@ -273,7 +273,7 @@ int CubicSDR::getPPM() {
void CubicSDR::showFrequencyInput() {
FrequencyDialog fdialog(appframe, -1, demodMgr.getActiveDemodulator()?_("Set Demodulator Frequency"):_("Set Frequency"), demodMgr.getActiveDemodulator(), wxPoint(-100,-100), wxSize(320, 75 ));
FrequencyDialog fdialog(appframe, -1, demodMgr.getActiveDemodulator()?_("Set Demodulator Frequency"):_("Set Center Frequency"), demodMgr.getActiveDemodulator(), wxPoint(-100,-100), wxSize(320, 75 ));
fdialog.ShowModal();
}

View File

@ -5,12 +5,12 @@
#include <iomanip>
#include "CubicSDR.h"
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog)
EVT_CHAR_HOOK(FrequencyDialog::OnChar)
wxBEGIN_EVENT_TABLE(FrequencyDialog, wxDialog) EVT_CHAR_HOOK(FrequencyDialog::OnChar)
wxEND_EVENT_TABLE()
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstance *demod, const wxPoint & position, const wxSize & size, long style) :
wxDialog(parent, id, title, position, size, style) {
FrequencyDialog::FrequencyDialog(wxWindow * parent, wxWindowID id, const wxString & title, DemodulatorInstance *demod, const wxPoint & position,
const wxSize & size, long style) :
wxDialog(parent, id, title, position, size, style) {
wxString freqStr;
activeDemod = demod;
@ -20,7 +20,8 @@ wxDialog(parent, id, title, position, size, style) {
freqStr = frequencyToStr(wxGetApp().getFrequency());
}
dialogText = new wxTextCtrl(this, wxID_FREQ_INPUT, freqStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70), wxTE_PROCESS_ENTER);
dialogText = new wxTextCtrl(this, wxID_FREQ_INPUT, freqStr, wxPoint(6, 1), wxSize(size.GetWidth() - 20, size.GetHeight() - 70),
wxTE_PROCESS_ENTER);
dialogText->SetFont(wxFont(20, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
Centre();
@ -122,7 +123,8 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
std::string allowed("0123456789.MKGHZmkghz");
if (allowed.find_first_of(c) != std::string::npos || c == WXK_BACK) {
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)) {
event.DoAllowNextEvent();
} else if (event.ControlDown() && c == 'V') {
// Alter clipboard contents to remove unwanted chars

View File

@ -346,7 +346,7 @@ void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
SetCursor(wxCURSOR_CROSS);
hoverIndex = 0;
hoverState = TUNING_HOVER_NONE;
wxGetApp().getDemodMgr().setActiveDemodulator(wxGetApp().getDemodMgr().getLastActiveDemodulator());
wxGetApp().getDemodMgr().setActiveDemodulator(NULL);
if (currentPPM != lastPPM) {
wxGetApp().saveConfig();
@ -368,7 +368,7 @@ void TuningCanvas::setHelpTip(std::string tip) {
void TuningCanvas::OnKeyDown(wxKeyEvent& event) {
InteractiveCanvas::OnKeyDown(event);
if (event.GetKeyCode() == WXK_SPACE && hoverState == TUNING_HOVER_CENTER || hoverState == TUNING_HOVER_FREQ) {
if (event.GetKeyCode() == WXK_SPACE && (hoverState == TUNING_HOVER_CENTER || hoverState == TUNING_HOVER_FREQ)) {
wxGetApp().showFrequencyInput();
}
}

View File

@ -193,6 +193,8 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
}
}
glContext->setHoverAlpha(0);
for (int i = 0, iMax = demods.size(); i < iMax; i++) {
if (activeDemodulator == demods[i] || lastActiveDemodulator == demods[i]) {
continue;