]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes to newly added i18n code in XRC - don't use it if wxXRC_USE_LOCALE isn't used
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 1 Sep 2002 17:11:38 +0000 (17:11 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 1 Sep 2002 17:11:38 +0000 (17:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
contrib/include/wx/xrc/xmlres.h
contrib/src/xrc/xh_chckl.cpp
contrib/src/xrc/xh_choic.cpp
contrib/src/xrc/xh_combo.cpp
contrib/src/xrc/xh_listb.cpp
contrib/src/xrc/xh_radbx.cpp
include/wx/xrc/xmlres.h
src/xrc/xh_chckl.cpp
src/xrc/xh_choic.cpp
src/xrc/xh_combo.cpp
src/xrc/xh_listb.cpp
src/xrc/xh_radbx.cpp

index 4e539a17c50b10a4f622582c0d9dcdf2030d7e4e..0962b297aa9ef37be5f92cb406d774547b314c57 100644 (file)
@@ -215,6 +215,9 @@ public:
     // Sets the global resources object and returns a pointer to the previous one (may be NULL).
     static wxXmlResource *Set(wxXmlResource *res);
 
+    // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
+    int GetFlags() { return m_flags; }
+
 protected:
     // Scans the resources list for unloaded files and loads them. Also reloads
     // files that have been modified since last loading.
@@ -229,9 +232,6 @@ protected:
     // Creates a resource from information in the given node.
     wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL);
 
-    // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
-    int GetFlags() { return m_flags; }
-
 private:
     long m_version;
 
index 24e191e830dec1dfac86157c27ed0eaec279c7a0..408c02570dd950022cbc7dd36b17b2e1f0c5bd5f 100644 (file)
@@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
         // handle <item checked="boolean">Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
         return NULL;
     }
 }
index 2f91e382a8f204a5b9afc96343094dfb3d9d9b27..f2dd0bdb43b5f3ed90444be3996bca6da64f407d 100644 (file)
@@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource()
         // handle <item>Label</item>
         
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 3d708c3a49256e4b365ea075931bc52fb97947a6..2a17231c4f939cdd60b6ffd553bab2430b34cfe2 100644 (file)
@@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
         // handle <item>Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 50790fbb34fe89717984b3b8bce3f4c96d1d8005..c3c9004d3f2f45a2020fce4aa84526eff33b0ca0 100644 (file)
@@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource()
         // handle <item>Label</item>
         
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 6ba0e86182b098520cde51ab9127139826e7c7e7..f2f229cd9c753de3855b9c70e0201b418eec554d 100644 (file)
@@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
         // handle <item selected="boolean">Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 4e539a17c50b10a4f622582c0d9dcdf2030d7e4e..0962b297aa9ef37be5f92cb406d774547b314c57 100644 (file)
@@ -215,6 +215,9 @@ public:
     // Sets the global resources object and returns a pointer to the previous one (may be NULL).
     static wxXmlResource *Set(wxXmlResource *res);
 
+    // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
+    int GetFlags() { return m_flags; }
+
 protected:
     // Scans the resources list for unloaded files and loads them. Also reloads
     // files that have been modified since last loading.
@@ -229,9 +232,6 @@ protected:
     // Creates a resource from information in the given node.
     wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL);
 
-    // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
-    int GetFlags() { return m_flags; }
-
 private:
     long m_version;
 
index 24e191e830dec1dfac86157c27ed0eaec279c7a0..408c02570dd950022cbc7dd36b17b2e1f0c5bd5f 100644 (file)
@@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
         // handle <item checked="boolean">Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
         return NULL;
     }
 }
index 2f91e382a8f204a5b9afc96343094dfb3d9d9b27..f2dd0bdb43b5f3ed90444be3996bca6da64f407d 100644 (file)
@@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource()
         // handle <item>Label</item>
         
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 3d708c3a49256e4b365ea075931bc52fb97947a6..2a17231c4f939cdd60b6ffd553bab2430b34cfe2 100644 (file)
@@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
         // handle <item>Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 50790fbb34fe89717984b3b8bce3f4c96d1d8005..c3c9004d3f2f45a2020fce4aa84526eff33b0ca0 100644 (file)
@@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource()
         // handle <item>Label</item>
         
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }
index 6ba0e86182b098520cde51ab9127139826e7c7e7..f2f229cd9c753de3855b9c70e0201b418eec554d 100644 (file)
@@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
         // handle <item selected="boolean">Label</item>
 
         // add to the list
-        strList.Add(wxGetTranslation(GetNodeContent(m_node)));
+        wxString str = GetNodeContent(m_node);
+        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
+            str = wxGetTranslation(str);
+        strList.Add(str);
 
         return NULL;
     }