diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index e163bcc..26ce8ff 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -518,7 +518,11 @@ void AppFrame::OnIdle(wxIdleEvent& event) { } } - if (!waterfallCanvas->HasFocus()) { + if (demodTuner->getMouseTracker()->mouseInView()) { + if (!demodTuner->HasFocus()) { + demodTuner->SetFocus(); + } + } else if (!waterfallCanvas->HasFocus()) { waterfallCanvas->SetFocus(); } diff --git a/src/visual/TuningCanvas.cpp b/src/visual/TuningCanvas.cpp index b3f950a..30e8479 100644 --- a/src/visual/TuningCanvas.cpp +++ b/src/visual/TuningCanvas.cpp @@ -22,6 +22,7 @@ EVT_LEFT_DOWN(TuningCanvas::OnMouseDown) EVT_LEFT_UP(TuningCanvas::OnMouseReleased) EVT_LEAVE_WINDOW(TuningCanvas::OnMouseLeftWindow) EVT_ENTER_WINDOW(TuningCanvas::OnMouseEnterWindow) +EVT_MOUSEWHEEL(TuningCanvas::OnMouseWheelMoved) wxEND_EVENT_TABLE() TuningCanvas::TuningCanvas(wxWindow *parent, int *attribList) : @@ -266,6 +267,16 @@ void TuningCanvas::OnMouseDown(wxMouseEvent& event) { void TuningCanvas::OnMouseWheelMoved(wxMouseEvent& event) { InteractiveCanvas::OnMouseWheelMoved(event); + + int hExponent = hoverIndex - 1; + + if (hoverState != TUNING_HOVER_NONE && !mouseTracker.mouseDown() && hoverIndex) { + if (event.m_wheelAxis == wxMOUSE_WHEEL_VERTICAL) { + StepTuner(hoverState, hExponent, (event.m_wheelRotation > 0)?true:false); + } else { + StepTuner(hoverState, hExponent, (event.m_wheelRotation < 0)?true:false); + } + } } void TuningCanvas::OnMouseReleased(wxMouseEvent& event) {