mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -05:00
Mouse wheel support for tuning bar digits
This commit is contained in:
parent
2dada587d1
commit
4f2b9d93c3
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user