1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 15:53:52 +02:00

Fix TAB key navigation on Mac for all dialogs (not only for panels)

This commit is contained in:
Paul Licameli
2016-07-10 17:10:50 -04:00
parent e0f6ed9972
commit 84c0337aba
79 changed files with 206 additions and 207 deletions

View File

@@ -1236,7 +1236,7 @@ enum
ID_SLIDER_CHANNEL
};
BEGIN_EVENT_TABLE( ExportMixerDialog,wxDialog )
BEGIN_EVENT_TABLE( ExportMixerDialog, wxDialogWrapper )
EVT_BUTTON( wxID_OK, ExportMixerDialog::OnOk )
EVT_BUTTON( wxID_CANCEL, ExportMixerDialog::OnCancel )
EVT_SIZE( ExportMixerDialog::OnSize )
@@ -1246,7 +1246,7 @@ END_EVENT_TABLE()
ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly,
int maxNumChannels, wxWindow *parent, wxWindowID id, const wxString &title,
const wxPoint &position, const wxSize& size, long style ) :
wxDialog( parent, id, title, position, size, style | wxRESIZE_BORDER )
wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
{
SetName(GetTitle());

View File

@@ -248,7 +248,7 @@ private:
//----------------------------------------------------------------------------
// ExportMixerDialog
//----------------------------------------------------------------------------
class ExportMixerDialog final : public wxDialog
class ExportMixerDialog final : public wxDialogWrapper
{
public:
// constructors and destructors

View File

@@ -498,7 +498,7 @@ int ExportCL::Export(AudacityProject *project,
// Display output on error or if the user wants to see it
if (process.GetStatus() != 0 || show) {
// TODO use ShowInfoDialog() instead.
wxDialog dlg(NULL,
wxDialogWrapper dlg(nullptr,
wxID_ANY,
wxString(_("Command Output")),
wxDefaultPosition,

View File

@@ -937,7 +937,7 @@ void ExportFFmpeg::SetMetadata(const Tags *tags, const char *name, const wxChar
int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate, const int *sampRates)
{
wxDialog d(NULL, wxID_ANY, wxString(_("Invalid sample rate")));
wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate")));
d.SetName(d.GetTitle());
wxChoice *choice;
ShuttleGui S(&d, eIsCreating);

View File

@@ -874,7 +874,7 @@ void FFmpegPresets::WriteXML(XMLWriter &xmlFile)
// ExportFFmpegOptions Class
//----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(ExportFFmpegOptions, wxDialog)
BEGIN_EVENT_TABLE(ExportFFmpegOptions, wxDialogWrapper)
EVT_BUTTON(wxID_OK,ExportFFmpegOptions::OnOK)
EVT_LISTBOX(FEFormatID,ExportFFmpegOptions::OnFormatList)
EVT_LISTBOX(FECodecID,ExportFFmpegOptions::OnCodecList)
@@ -1303,7 +1303,7 @@ ExportFFmpegOptions::~ExportFFmpegOptions()
}
ExportFFmpegOptions::ExportFFmpegOptions(wxWindow *parent)
: wxDialog(parent, wxID_ANY,
: wxDialogWrapper(parent, wxID_ANY,
wxString(_("Configure custom FFmpeg options")))
{
SetName(GetTitle());

View File

@@ -176,7 +176,7 @@ struct ApplicableFor
class FFmpegPresets;
/// Custom FFmpeg export dialog
class ExportFFmpegOptions final : public wxDialog
class ExportFFmpegOptions final : public wxDialogWrapper
{
public:

View File

@@ -580,14 +580,14 @@ int ExportMP3Options::FindIndex(CHOICES *choices, int cnt, int needle, int def)
#define ID_BROWSE 5000
#define ID_DLOAD 5001
class FindDialog final : public wxDialog
class FindDialog final : public wxDialogWrapper
{
public:
#ifndef DISABLE_DYNAMIC_LOADING_LAME
FindDialog(wxWindow *parent, wxString path, wxString name, wxString type)
: wxDialog(parent, wxID_ANY,
: wxDialogWrapper(parent, wxID_ANY,
/* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
wxString(_("Locate Lame")))
{
@@ -702,7 +702,7 @@ private:
};
#ifndef DISABLE_DYNAMIC_LOADING_LAME
BEGIN_EVENT_TABLE(FindDialog, wxDialog)
BEGIN_EVENT_TABLE(FindDialog, wxDialogWrapper)
EVT_BUTTON(ID_BROWSE, FindDialog::OnBrowse)
EVT_BUTTON(ID_DLOAD, FindDialog::OnDownload)
END_EVENT_TABLE()
@@ -1928,7 +1928,7 @@ wxString ExportMP3::FindName(CHOICES *choices, int cnt, int needle)
int ExportMP3::AskResample(int bitrate, int rate, int lowrate, int highrate)
{
wxDialog d(NULL, wxID_ANY, wxString(_("Invalid sample rate")));
wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate")));
d.SetName(d.GetTitle());
wxChoice *choice;
ShuttleGui S(&d, eIsCreating);

View File

@@ -77,7 +77,7 @@ enum {
// ExportMultiple methods
//
BEGIN_EVENT_TABLE(ExportMultiple, wxDialog)
BEGIN_EVENT_TABLE(ExportMultiple, wxDialogWrapper)
EVT_CHOICE(FormatID, ExportMultiple::OnFormat)
// EVT_BUTTON(OptionsID, ExportMultiple::OnOptions)
EVT_BUTTON(CreateID, ExportMultiple::OnCreate)
@@ -94,7 +94,7 @@ BEGIN_EVENT_TABLE(ExportMultiple, wxDialog)
EVT_TEXT(PrefixID, ExportMultiple::OnPrefix)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(SuccessDialog, wxDialog)
BEGIN_EVENT_TABLE(SuccessDialog, wxDialogWrapper)
EVT_LIST_KEY_DOWN(wxID_ANY, SuccessDialog::OnKeyDown)
EVT_LIST_ITEM_ACTIVATED(wxID_ANY, SuccessDialog::OnItemActivated) // happens when <enter> is pressed with list item having focus
END_EVENT_TABLE()
@@ -104,7 +104,7 @@ BEGIN_EVENT_TABLE(MouseEvtHandler, wxEvtHandler)
END_EVENT_TABLE()
ExportMultiple::ExportMultiple(AudacityProject *project)
: wxDialog(project, wxID_ANY, wxString(_("Export Multiple")))
: wxDialogWrapper(project, wxID_ANY, wxString(_("Export Multiple")))
{
SetName(GetTitle());
@@ -208,7 +208,7 @@ int ExportMultiple::ShowModal()
EnableControls();
return wxDialog::ShowModal();
return wxDialogWrapper::ShowModal();
}
void ExportMultiple::PopulateOrExchange(ShuttleGui& S)

View File

@@ -30,7 +30,7 @@ class AudacityProject;
class LabelTrack;
class ShuttleGui;
class ExportMultiple final : public wxDialog
class ExportMultiple final : public wxDialogWrapper
{
public:
@@ -163,11 +163,11 @@ private:
};
class SuccessDialog final : public wxDialog
class SuccessDialog final : public wxDialogWrapper
{
public:
SuccessDialog(wxWindow *parent, wxWindowID id, const wxString &title) :
wxDialog(parent, id, title, wxDefaultPosition,
wxDialogWrapper(parent, id, title, wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {};
void OnKeyDown(wxListEvent& event); // dismisses dialog when <enter> is pressed with list control having focus
void OnItemActivated(wxListEvent& event); // dismisses dialog when <enter> is pressed with list item having focus