1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-28 15:38:48 +01:00

Define wxDirDialogWrapper, with localized default prompt and name

This commit is contained in:
Paul Licameli
2017-10-12 15:23:52 -04:00
parent 729fd3767c
commit cf4b9eb5c8
4 changed files with 40 additions and 3 deletions

View File

@@ -100,4 +100,41 @@ public:
}
};
#include <wx/dirdlg.h>
class wxDirDialogWrapper : public wxTabTraversalWrapper<wxDirDialog>
{
public:
wxDirDialogWrapper() {}
// Constructor with no modal flag - the new convention.
wxDirDialogWrapper(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("Directory Dialog"))
: wxTabTraversalWrapper<wxDirDialog>
{ parent, message, defaultPath, style, pos, size, name }
{}
void Create(
wxWindow *parent,
const wxString& message = _("Select a directory"),
const wxString& defaultPath = wxT(""),
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
// Important: default window name localizes!
const wxString& name = _("Directory Dialog"))
{
return wxTabTraversalWrapper<wxDirDialog>::Create(
parent, message, defaultPath, style, pos, size, name
);
}
};
#endif