fixes to newly added i18n code in XRC - don't use it if wxXRC_USE_LOCALE isn't used

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2002-09-01 17:11:38 +00:00
parent bbcd408aa7
commit 74c107ba48
12 changed files with 46 additions and 16 deletions

View File

@ -215,6 +215,9 @@ public:
// Sets the global resources object and returns a pointer to the previous one (may be NULL). // Sets the global resources object and returns a pointer to the previous one (may be NULL).
static wxXmlResource *Set(wxXmlResource *res); 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: protected:
// Scans the resources list for unloaded files and loads them. Also reloads // Scans the resources list for unloaded files and loads them. Also reloads
// files that have been modified since last loading. // files that have been modified since last loading.
@ -229,9 +232,6 @@ protected:
// Creates a resource from information in the given node. // Creates a resource from information in the given node.
wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL); 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: private:
long m_version; long m_version;

View File

@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
// handle <item checked="boolean">Label</item> // handle <item checked="boolean">Label</item>
// add to the list // 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; return NULL;
} }
} }

View File

@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
// handle <item selected="boolean">Label</item> // handle <item selected="boolean">Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -215,6 +215,9 @@ public:
// Sets the global resources object and returns a pointer to the previous one (may be NULL). // Sets the global resources object and returns a pointer to the previous one (may be NULL).
static wxXmlResource *Set(wxXmlResource *res); 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: protected:
// Scans the resources list for unloaded files and loads them. Also reloads // Scans the resources list for unloaded files and loads them. Also reloads
// files that have been modified since last loading. // files that have been modified since last loading.
@ -229,9 +232,6 @@ protected:
// Creates a resource from information in the given node. // Creates a resource from information in the given node.
wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL); 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: private:
long m_version; long m_version;

View File

@ -91,7 +91,10 @@ wxObject *wxCheckListXmlHandler::DoCreateResource()
// handle <item checked="boolean">Label</item> // handle <item checked="boolean">Label</item>
// add to the list // 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; return NULL;
} }
} }

View File

@ -77,7 +77,10 @@ wxObject *wxChoiceXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -83,7 +83,10 @@ wxObject *wxComboBoxXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -83,7 +83,10 @@ wxObject *wxListBoxXmlHandler::DoCreateResource()
// handle <item>Label</item> // handle <item>Label</item>
// add to the list // 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; return NULL;
} }

View File

@ -84,7 +84,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
// handle <item selected="boolean">Label</item> // handle <item selected="boolean">Label</item>
// add to the list // 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; return NULL;
} }