don't translate accelerators in XRC menus

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-02-15 19:41:43 +00:00
parent 2d1efe3fec
commit ee1046d1cf
6 changed files with 10 additions and 10 deletions

View File

@@ -344,9 +344,9 @@ protected:
// Gets text from param and does some conversions: // Gets text from param and does some conversions:
// - replaces \n, \r, \t by respective chars (according to C syntax) // - replaces \n, \r, \t by respective chars (according to C syntax)
// - replaces $ by & and $$ by $ (needed for $File => &File because of XML) // - replaces _ by & and __ by _ (needed for _File => &File because of XML)
// - calls wxGetTranslations (unless disabled in wxXmlResource) // - calls wxGetTranslations (unless disabled in wxXmlResource)
wxString GetText(const wxString& param); wxString GetText(const wxString& param, bool translate = TRUE);
// Returns the XRCID. // Returns the XRCID.
int GetID(); int GetID();

View File

@@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
int id = GetID(); int id = GetID();
bool checkable = GetBool(wxT("checkable")); bool checkable = GetBool(wxT("checkable"));
wxString label = GetText(wxT("label")); wxString label = GetText(wxT("label"));
wxString accel = GetText(wxT("accel")); wxString accel = GetText(wxT("accel"), FALSE);
wxString fullLabel = label; wxString fullLabel = label;
if (!accel.IsEmpty()) if (!accel.IsEmpty())
fullLabel << wxT("\t") << accel; fullLabel << wxT("\t") << accel;

View File

@@ -631,14 +631,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
wxString wxXmlResourceHandler::GetText(const wxString& param) wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
{ {
wxString str1; wxString str1;
wxString str2; wxString str2;
const wxChar *dt; const wxChar *dt;
wxChar amp_char; wxChar amp_char;
if (m_resource->GetFlags() & wxXRC_USE_LOCALE) if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
str1 = wxGetTranslation(GetParamValue(param)); str1 = wxGetTranslation(GetParamValue(param));
else else
str1 = GetParamValue(param); str1 = GetParamValue(param);

View File

@@ -344,9 +344,9 @@ protected:
// Gets text from param and does some conversions: // Gets text from param and does some conversions:
// - replaces \n, \r, \t by respective chars (according to C syntax) // - replaces \n, \r, \t by respective chars (according to C syntax)
// - replaces $ by & and $$ by $ (needed for $File => &File because of XML) // - replaces _ by & and __ by _ (needed for _File => &File because of XML)
// - calls wxGetTranslations (unless disabled in wxXmlResource) // - calls wxGetTranslations (unless disabled in wxXmlResource)
wxString GetText(const wxString& param); wxString GetText(const wxString& param, bool translate = TRUE);
// Returns the XRCID. // Returns the XRCID.
int GetID(); int GetID();

View File

@@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
int id = GetID(); int id = GetID();
bool checkable = GetBool(wxT("checkable")); bool checkable = GetBool(wxT("checkable"));
wxString label = GetText(wxT("label")); wxString label = GetText(wxT("label"));
wxString accel = GetText(wxT("accel")); wxString accel = GetText(wxT("accel"), FALSE);
wxString fullLabel = label; wxString fullLabel = label;
if (!accel.IsEmpty()) if (!accel.IsEmpty())
fullLabel << wxT("\t") << accel; fullLabel << wxT("\t") << accel;

View File

@@ -631,14 +631,14 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
wxString wxXmlResourceHandler::GetText(const wxString& param) wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
{ {
wxString str1; wxString str1;
wxString str2; wxString str2;
const wxChar *dt; const wxChar *dt;
wxChar amp_char; wxChar amp_char;
if (m_resource->GetFlags() & wxXRC_USE_LOCALE) if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE)
str1 = wxGetTranslation(GetParamValue(param)); str1 = wxGetTranslation(GetParamValue(param));
else else
str1 = GetParamValue(param); str1 = GetParamValue(param);