help tip updates, tuning bar support

This commit is contained in:
Charles J. Cliffe 2015-05-10 02:30:50 -04:00
parent 4f9c623fec
commit fc21d96c12
2 changed files with 20 additions and 8 deletions

View File

@ -271,21 +271,28 @@ void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
} else { } else {
switch (hoverState) { switch (hoverState) {
case TUNING_HOVER_FREQ: 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; break;
case TUNING_HOVER_BW: case TUNING_HOVER_BW:
setStatusText("Click, wheel or drag a digit to change bandwidth. Hold SHIFT to disable carry."); setStatusText("Click, wheel or drag a digit to change bandwidth. Hold SHIFT to disable carry.");
break; break;
case TUNING_HOVER_CENTER: 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; break;
case TUNING_HOVER_PPM: case TUNING_HOVER_PPM:
setStatusText("Click, wheel or drag a digit to change device PPM offset. Hold SHIFT to disable carry."); setStatusText("Click, wheel or drag a digit to change device PPM offset. Hold SHIFT to disable carry.");
break; 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) { void TuningCanvas::OnMouseDown(wxMouseEvent& event) {
@ -339,6 +346,7 @@ void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
SetCursor(wxCURSOR_CROSS); SetCursor(wxCURSOR_CROSS);
hoverIndex = 0; hoverIndex = 0;
hoverState = TUNING_HOVER_NONE; hoverState = TUNING_HOVER_NONE;
wxGetApp().getDemodMgr().setActiveDemodulator(wxGetApp().getDemodMgr().getLastActiveDemodulator());
if (currentPPM != lastPPM) { if (currentPPM != lastPPM) {
wxGetApp().saveConfig(); wxGetApp().saveConfig();
@ -359,6 +367,10 @@ void TuningCanvas::setHelpTip(std::string tip) {
void TuningCanvas::OnKeyDown(wxKeyEvent& event) { void TuningCanvas::OnKeyDown(wxKeyEvent& event) {
InteractiveCanvas::OnKeyDown(event); InteractiveCanvas::OnKeyDown(event);
if (event.GetKeyCode() == WXK_SPACE && hoverState == TUNING_HOVER_CENTER || hoverState == TUNING_HOVER_FREQ) {
wxGetApp().showFrequencyInput();
}
} }
void TuningCanvas::OnKeyUp(wxKeyEvent& event) { void TuningCanvas::OnKeyUp(wxKeyEvent& event) {

View File

@ -141,7 +141,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
ColorTheme *currentTheme = ThemeMgr::mgr.currentTheme; ColorTheme *currentTheme = ThemeMgr::mgr.currentTheme;
int last_type = wxGetApp().getDemodMgr().getLastDemodulatorType(); int last_type = wxGetApp().getDemodMgr().getLastDemodulatorType();
if (mouseTracker.mouseInView()) { if (mouseTracker.mouseInView() || wxGetApp().getDemodMgr().getActiveDemodulator()) {
hoverAlpha += (1.0f-hoverAlpha)*0.1f; hoverAlpha += (1.0f-hoverAlpha)*0.1f;
if (hoverAlpha > 1.5f) { if (hoverAlpha > 1.5f) {
hoverAlpha = 1.5f; hoverAlpha = 1.5f;
@ -713,23 +713,23 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
mouseTracker.setVertDragLock(true); mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false); 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 { } else {
SetCursor(wxCURSOR_SIZING); SetCursor(wxCURSOR_SIZING);
nextDragState = WF_DRAG_FREQUENCY; nextDragState = WF_DRAG_FREQUENCY;
mouseTracker.setVertDragLock(true); mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false); 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 { } else {
SetCursor(wxCURSOR_CROSS); SetCursor(wxCURSOR_CROSS);
nextDragState = WF_DRAG_NONE; nextDragState = WF_DRAG_NONE;
if (shiftDown) { 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 { } else {
setStatusText( 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.");
} }
} }