LABEL: Add a label edit dialog, much like FrequencyDialog, works not bad

This commit is contained in:
vsonnier
2016-06-11 10:08:12 +02:00
parent 00e241a784
commit d7d9fc8c32
9 changed files with 148 additions and 6 deletions
+2 -2
View File
@@ -381,14 +381,14 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
//demodulator user label if present: type is displayed above the label, which is at the bottom of the screen.
if (!demod->getDemodulatorUserLabel().empty()) {
hPos += 2 * labelHeight;
hPos += 1.3 * labelHeight;
}
drawSingleDemodLabel(demodStr, uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
//revert...
if (!demod->getDemodulatorUserLabel().empty()) {
hPos -= 2 * labelHeight;
hPos -= 1.3 * labelHeight;
drawSingleDemodLabel(demod->getDemodulatorUserLabel(), uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
}
+1 -1
View File
@@ -430,7 +430,7 @@ void TuningCanvas::OnKeyDown(wxKeyEvent& event) {
} else if (hoverState == TUNING_HOVER_BW) {
wxGetApp().showFrequencyInput(FrequencyDialog::FDIALOG_TARGET_BANDWIDTH);
}
}
}
}
void TuningCanvas::OnKeyUp(wxKeyEvent& event) {
+5 -2
View File
@@ -451,6 +451,9 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
case WXK_SPACE:
wxGetApp().showFrequencyInput();
break;
case 'E': //E is for 'Edit the label' of the active demodulator.
wxGetApp().showLabelInput();
break;
case 'C':
if (wxGetApp().getDemodMgr().getActiveDemodulator()) {
wxGetApp().setFrequency(wxGetApp().getDemodMgr().getActiveDemodulator()->getFrequency());
@@ -568,14 +571,14 @@ void WaterfallCanvas::updateHoverState() {
mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false);
setStatusText("Click and drag to change demodulator bandwidth. SPACE or numeric key for direct frequency input. [, ] to nudge, M for mute, D to delete, C to center.");
setStatusText("Click and drag to change demodulator bandwidth. SPACE or numeric key for direct frequency input. [, ] to nudge, M for mute, D to delete, C to center, E to edit label.");
} else {
SetCursor(wxCURSOR_SIZING);
nextDragState = WF_DRAG_FREQUENCY;
mouseTracker.setVertDragLock(true);
mouseTracker.setHorizDragLock(false);
setStatusText("Click and drag to change demodulator frequency; SPACE or numeric key for direct input. [, ] to nudge, M for mute, D to delete, C to center.");
setStatusText("Click and drag to change demodulator frequency; SPACE or numeric key for direct input. [, ] to nudge, M for mute, D to delete, C to center, E to edit label.");
}
} else {
SetCursor(wxCURSOR_CROSS);