From ee1046d1cf4ac8466754873594d32c605a93197e Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 15 Feb 2002 19:41:43 +0000 Subject: [PATCH] don't translate accelerators in XRC menus git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xrc/xmlres.h | 4 ++-- contrib/src/xrc/xh_menu.cpp | 2 +- contrib/src/xrc/xmlres.cpp | 4 ++-- include/wx/xrc/xmlres.h | 4 ++-- src/xrc/xh_menu.cpp | 2 +- src/xrc/xmlres.cpp | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/contrib/include/wx/xrc/xmlres.h b/contrib/include/wx/xrc/xmlres.h index 77bc74433e..779dd670c5 100644 --- a/contrib/include/wx/xrc/xmlres.h +++ b/contrib/include/wx/xrc/xmlres.h @@ -344,9 +344,9 @@ protected: // Gets text from param and does some conversions: // - 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) - wxString GetText(const wxString& param); + wxString GetText(const wxString& param, bool translate = TRUE); // Returns the XRCID. int GetID(); diff --git a/contrib/src/xrc/xh_menu.cpp b/contrib/src/xrc/xh_menu.cpp index 93d93e0892..bfa9ed1644 100644 --- a/contrib/src/xrc/xh_menu.cpp +++ b/contrib/src/xrc/xh_menu.cpp @@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource() int id = GetID(); bool checkable = GetBool(wxT("checkable")); wxString label = GetText(wxT("label")); - wxString accel = GetText(wxT("accel")); + wxString accel = GetText(wxT("accel"), FALSE); wxString fullLabel = label; if (!accel.IsEmpty()) fullLabel << wxT("\t") << accel; diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index bd45b37185..8a630df247 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -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 str2; const wxChar *dt; wxChar amp_char; - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE) str1 = wxGetTranslation(GetParamValue(param)); else str1 = GetParamValue(param); diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index 77bc74433e..779dd670c5 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -344,9 +344,9 @@ protected: // Gets text from param and does some conversions: // - 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) - wxString GetText(const wxString& param); + wxString GetText(const wxString& param, bool translate = TRUE); // Returns the XRCID. int GetID(); diff --git a/src/xrc/xh_menu.cpp b/src/xrc/xh_menu.cpp index 93d93e0892..bfa9ed1644 100644 --- a/src/xrc/xh_menu.cpp +++ b/src/xrc/xh_menu.cpp @@ -69,7 +69,7 @@ wxObject *wxMenuXmlHandler::DoCreateResource() int id = GetID(); bool checkable = GetBool(wxT("checkable")); wxString label = GetText(wxT("label")); - wxString accel = GetText(wxT("accel")); + wxString accel = GetText(wxT("accel"), FALSE); wxString fullLabel = label; if (!accel.IsEmpty()) fullLabel << wxT("\t") << accel; diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index bd45b37185..8a630df247 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -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 str2; const wxChar *dt; wxChar amp_char; - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) + if (translate && m_resource->GetFlags() & wxXRC_USE_LOCALE) str1 = wxGetTranslation(GetParamValue(param)); else str1 = GetParamValue(param); -- 2.45.2