1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-12 14:47:43 +02:00

Merge: wx3.x fixes.

Dave Avery's wx3 fixes for Audacity, without the .sln/,vcxproj file updates that add the new target.  These changes are believed to be safe for wx2.8.12, wx3.0.x and wx3.1.0.
This commit is contained in:
James Crook 2015-04-12 15:47:01 +01:00
commit 09def90346
4 changed files with 19 additions and 7 deletions

View File

@ -960,7 +960,11 @@ void AudacityApp::InitLang( const wxString & lang )
wxSetEnv(wxT("LANG"), wxT("en_US"));
#endif
#if wxCHECK_VERSION(3,0,0)
mLocale = new wxLocale(wxT(""), lang, wxT(""), true);
#else
mLocale = new wxLocale(wxT(""), lang, wxT(""), true, true);
#endif
#if defined(__WXMAC__)
if (existed) {

View File

@ -11,6 +11,9 @@
#include "Audacity.h"
#include <wx/defs.h>
#if wxCHECK_VERSION(3,0,0)
#include <wx/crt.h>
#endif
#include <wx/filename.h>
#include <wx/wfstream.h>

View File

@ -394,7 +394,7 @@ void CommandManager::InsertItem(wxString name, wxString label_in,
for (size_t lndx = 0; lndx < lcnt; lndx++) {
item = list.Item(lndx)->GetData();
if (item->GetLabel() == label) {
if (item->GetItemLabelText() == label) {
break;
}
pos++;
@ -681,7 +681,7 @@ int CommandManager::NewIdentifier(wxString name, wxString label, wxMenu *menu,
tmpEntry->label = label;
tmpEntry->labelPrefix = labelPrefix;
tmpEntry->labelTop = wxMenuItem::GetLabelFromText(mCurrentMenuName);
tmpEntry->labelTop = wxMenuItem::GetLabelText(mCurrentMenuName);
tmpEntry->menu = menu;
tmpEntry->callback = callback;
tmpEntry->multi = multi;
@ -975,7 +975,7 @@ void CommandManager::ToggleAccels(wxMenu *m, bool show)
}
// Set the new label
mi->SetText( label );
mi->SetItemLabel( label );
}
}
@ -1251,7 +1251,7 @@ wxString CommandManager::GetPrefixedLabelFromName(wxString name)
if (!entry->labelPrefix.IsEmpty()) {
prefix = entry->labelPrefix + wxT(" - ");
}
return wxMenuItem::GetLabelFromText(prefix + entry->label);
return wxMenuItem::GetLabelText(prefix + entry->label);
#else
return wxString(entry->labelPrefix + wxT(" ") + entry->label).Trim(false).Trim(true);
#endif
@ -1342,7 +1342,7 @@ void CommandManager::WriteXML(XMLWriter &xmlFile)
for(j=0; j<mCommandList.GetCount(); j++) {
wxString label = mCommandList[j]->label;
label = wxMenuItem::GetLabelFromText(label.BeforeFirst(wxT('\t')));
label = wxMenuItem::GetLabelText(label.BeforeFirst(wxT('\t')));
xmlFile.StartTag(wxT("command"));
xmlFile.WriteAttr(wxT("name"), mCommandList[j]->name);

View File

@ -477,7 +477,12 @@ void ReverbDialogue::OnStereoWidthWidget(wxCommandEvent & WXUNUSED(event))
static int wxGetChoiceFromUser(wxWindow * parent, wxString const & message,
wxString const & caption, wxArrayString const & choices,
char * * clientData = 0, long style = wxCHOICEDLG_STYLE,
#if wxCHECK_VERSION(3,0,0)
void * * clientData = 0,
#else
char * * clientData = 0,
#endif
long style = wxCHOICEDLG_STYLE,
wxPoint const & pos = wxDefaultPosition) // Home-grown function
{
wxSingleChoiceDialog d(parent, message, caption, choices, clientData, style, pos);