mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-11 17:13:37 +02:00
PrefsDialog can vary the title prefix string
This commit is contained in:
@@ -81,11 +81,14 @@ class wxTreebookExt : public wxTreebook
|
||||
{
|
||||
public:
|
||||
wxTreebookExt( wxWindow *parent,
|
||||
wxWindowID id) : wxTreebook( parent, id )
|
||||
wxWindowID id, const wxString &titlePrefix)
|
||||
: wxTreebook( parent, id )
|
||||
, mTitlePrefix(titlePrefix)
|
||||
{;};
|
||||
~wxTreebookExt(){;};
|
||||
virtual int ChangeSelection(size_t n);
|
||||
virtual int SetSelection(size_t n);
|
||||
const wxString mTitlePrefix;
|
||||
};
|
||||
|
||||
|
||||
@@ -100,7 +103,7 @@ int wxTreebookExt::ChangeSelection(size_t n) {
|
||||
int wxTreebookExt::SetSelection(size_t n)
|
||||
{
|
||||
int i = wxTreebook::SetSelection(n);
|
||||
wxString Temp = wxString(_("Preferences: ")) + GetPageText( n );
|
||||
wxString Temp = wxString(mTitlePrefix) + GetPageText( n );
|
||||
((wxDialog*)GetParent())->SetTitle( Temp );
|
||||
((wxDialog*)GetParent())->SetName( Temp );
|
||||
return i;
|
||||
@@ -178,12 +181,14 @@ PrefsDialog::Factories
|
||||
}
|
||||
|
||||
|
||||
PrefsDialog::PrefsDialog(wxWindow * parent, Factories &factories)
|
||||
PrefsDialog::PrefsDialog
|
||||
(wxWindow * parent, const wxString &titlePrefix, Factories &factories)
|
||||
: wxDialog(parent, wxID_ANY, wxString(_("Audacity Preferences")),
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
, mFactories(factories)
|
||||
, mTitlePrefix(titlePrefix)
|
||||
{
|
||||
ShuttleGui S(this, eIsCreating);
|
||||
|
||||
@@ -191,7 +196,7 @@ PrefsDialog::PrefsDialog(wxWindow * parent, Factories &factories)
|
||||
{
|
||||
S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, true);
|
||||
{
|
||||
mCategories = new wxTreebookExt(this, wxID_ANY);
|
||||
mCategories = new wxTreebookExt(this, wxID_ANY, mTitlePrefix);
|
||||
S.Prop(1);
|
||||
S.AddWindow(mCategories, wxEXPAND);
|
||||
|
||||
|
@@ -44,7 +44,9 @@ class PrefsDialog:public wxDialog
|
||||
typedef std::vector<PrefsNode> Factories;
|
||||
static Factories &DefaultFactories();
|
||||
|
||||
PrefsDialog(wxWindow * parent, Factories &factories = DefaultFactories());
|
||||
PrefsDialog(wxWindow * parent,
|
||||
const wxString &titlePrefix = _("Preferences: "),
|
||||
Factories &factories = DefaultFactories());
|
||||
virtual ~PrefsDialog();
|
||||
|
||||
void OnCategoryChange(wxCommandEvent & e);
|
||||
@@ -60,6 +62,7 @@ class PrefsDialog:public wxDialog
|
||||
|
||||
wxTreebook *mCategories;
|
||||
Factories &mFactories;
|
||||
const wxString mTitlePrefix;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
Reference in New Issue
Block a user