From fc21d96c125da890e0f9806a8ba00a71e3edcd36 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Sun, 10 May 2015 02:30:50 -0400 Subject: [PATCH] help tip updates, tuning bar support --- src/visual/TuningCanvas.cpp | 18 +++++++++++++++--- src/visual/WaterfallCanvas.cpp | 10 +++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/visual/TuningCanvas.cpp b/src/visual/TuningCanvas.cpp index d65bbaa..216f5e0 100644 --- a/src/visual/TuningCanvas.cpp +++ b/src/visual/TuningCanvas.cpp @@ -271,21 +271,28 @@ void TuningCanvas::OnMouseMoved(wxMouseEvent& event) { } else { switch (hoverState) { case TUNING_HOVER_FREQ: - setStatusText("Click, wheel or drag a digit to change frequency. Hold ALT to change PPM. Hold SHIFT to disable carry."); + setStatusText("Click, wheel or drag a digit to change frequency; SPACE for direct input. Hold ALT to change PPM. Hold SHIFT to disable carry."); break; case TUNING_HOVER_BW: setStatusText("Click, wheel or drag a digit to change bandwidth. Hold SHIFT to disable carry."); break; case TUNING_HOVER_CENTER: - setStatusText("Click, wheel or drag a digit to change center frequency. Hold SHIFT to disable carry."); + setStatusText("Click, wheel or drag a digit to change center frequency; SPACE for direct input. Hold SHIFT to disable carry."); break; case TUNING_HOVER_PPM: setStatusText("Click, wheel or drag a digit to change device PPM offset. Hold SHIFT to disable carry."); break; + case TUNING_HOVER_NONE: + setStatusText(""); + break; } } - + if (hoverState == TUNING_HOVER_BW || hoverState == TUNING_HOVER_FREQ) { + wxGetApp().getDemodMgr().setActiveDemodulator(wxGetApp().getDemodMgr().getLastActiveDemodulator()); + } else { + wxGetApp().getDemodMgr().setActiveDemodulator(NULL); + } } void TuningCanvas::OnMouseDown(wxMouseEvent& event) { @@ -339,6 +346,7 @@ void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) { SetCursor(wxCURSOR_CROSS); hoverIndex = 0; hoverState = TUNING_HOVER_NONE; + wxGetApp().getDemodMgr().setActiveDemodulator(wxGetApp().getDemodMgr().getLastActiveDemodulator()); if (currentPPM != lastPPM) { wxGetApp().saveConfig(); @@ -359,6 +367,10 @@ 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) { + wxGetApp().showFrequencyInput(); + } } void TuningCanvas::OnKeyUp(wxKeyEvent& event) { diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 657766d..abbc52e 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -141,7 +141,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { ColorTheme *currentTheme = ThemeMgr::mgr.currentTheme; int last_type = wxGetApp().getDemodMgr().getLastDemodulatorType(); - if (mouseTracker.mouseInView()) { + if (mouseTracker.mouseInView() || wxGetApp().getDemodMgr().getActiveDemodulator()) { hoverAlpha += (1.0f-hoverAlpha)*0.1f; if (hoverAlpha > 1.5f) { hoverAlpha = 1.5f; @@ -713,23 +713,23 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) { mouseTracker.setVertDragLock(true); mouseTracker.setHorizDragLock(false); - setStatusText("Click and drag to change demodulator bandwidth. D to delete, S for stereo."); + setStatusText("Click and drag to change demodulator bandwidth. SPACE for direct frequency input. D to delete, S for stereo."); } else { SetCursor(wxCURSOR_SIZING); nextDragState = WF_DRAG_FREQUENCY; mouseTracker.setVertDragLock(true); mouseTracker.setHorizDragLock(false); - setStatusText("Click and drag to change demodulator frequency. D to delete, S for stereo."); + setStatusText("Click and drag to change demodulator frequency; SPACE for direct input. D to delete, S for stereo."); } } else { SetCursor(wxCURSOR_CROSS); nextDragState = WF_DRAG_NONE; if (shiftDown) { - setStatusText("Click to create a new demodulator or hold ALT to drag range."); + setStatusText("Click to create a new demodulator or hold ALT to drag range, SPACE for direct center frequency input."); } else { setStatusText( - "Click to move active demodulator frequency or hold ALT to drag range; hold SHIFT to create new. Right drag or A / Z to Zoom. Arrow keys (+SHIFT) to move center frequency."); + "Click to move active demodulator frequency or hold ALT to drag range; hold SHIFT to create new. Right drag or A / Z to Zoom. Arrow keys (+SHIFT) to move center frequency; SPACE for direct input."); } }