1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Add an option to use a dialog to enter the name of a new label

Motivation:
1. The text boxes in the label track are not fully accessible for users of screen readers, and I don't think that they can be made to be fully accessible using the accessibility API used by wxWidgets. When such an edit box becomes the focus, this is not announced, and for NVDA users typed characters are not echoed.

2. Provides a work around for bugs 1778 (cannot type diacritics into text label), and 1804 (Windows: Labels do not accept IME (Chinese/Japanese) input).

Fix: Provide an option for a dialog for entering the name. The text box in the dialog is accessible for screen readers. On windows the text box receives wm_keydown and wm_char messages and so is a work around for bug 1804. Being a standard text box, it will presumably be a work around for bug 1778.

1. There is a new option in track behaviors: "Use dialog for the name of new label", which is off by default.

2. When using the commands "Add label at selection" and "Add label at playback position", when the dialog closes, focus is returned to the track which was the focus before the dialog opened. I think this is more convenient for users of screen readers.
This commit is contained in:
David Bailes
2018-03-21 14:16:05 +00:00
parent a06e845b2f
commit a13e7191c4
7 changed files with 105 additions and 25 deletions

View File

@@ -2098,10 +2098,24 @@ bool LabelTrack::OnChar(SelectedRegion &WXUNUSED(newSel), wxKeyEvent & event)
event.Skip();
return false;
}
SetSelected(true);
bool useDialog;
AudacityProject *p = GetActiveProject();
AddLabel(p->mViewInfo.selectedRegion);
p->PushState(_("Added label"), _("Label"));
gPrefs->Read(wxT("/Gui/DialogForNameNewLabel"), &useDialog, false);
if (useDialog) {
wxString title;
if (p->DialogForLabelName(charCode, title) == wxID_CANCEL) {
return false;
}
SetSelected(true);
AddLabel(p->mViewInfo.selectedRegion, title, -2);
p->PushState(_("Added label"), _("Label"));
return false;
}
else {
SetSelected(true);
AddLabel(p->mViewInfo.selectedRegion);
p->PushState(_("Added label"), _("Label"));
}
}
//