]> git.saurik.com Git - wxWidgets.git/commitdiff
don't translate accelerators in XRC menus
authorVáclav Slavík <vslavik@fastmail.fm>
Fri, 15 Feb 2002 19:41:43 +0000 (19:41 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Fri, 15 Feb 2002 19:41:43 +0000 (19:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/include/wx/xrc/xmlres.h
contrib/src/xrc/xh_menu.cpp
contrib/src/xrc/xmlres.cpp
include/wx/xrc/xmlres.h
src/xrc/xh_menu.cpp
src/xrc/xmlres.cpp

index 77bc74433e783f9d2101927fa758068ff91af2db..779dd670c5238548dd64e6202491b79520018da2 100644 (file)
@@ -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();
index 93d93e08921e10f0e29ccd3036d43745e037ef67..bfa9ed1644115a56362e904d24186e7bc642a524 100644 (file)
@@ -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;
index bd45b371852f511a889089724eac878cd1d1e5e5..8a630df247f49595afa36930e8d284bfbb10146c 100644 (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 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);
index 77bc74433e783f9d2101927fa758068ff91af2db..779dd670c5238548dd64e6202491b79520018da2 100644 (file)
@@ -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();
index 93d93e08921e10f0e29ccd3036d43745e037ef67..bfa9ed1644115a56362e904d24186e7bc642a524 100644 (file)
@@ -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;
index bd45b371852f511a889089724eac878cd1d1e5e5..8a630df247f49595afa36930e8d284bfbb10146c 100644 (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 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);