X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91cddacfe014ae0b0afd78cfc866494f4b5e9090..34dc8f910f88dc39a2f5fd9c3d894d797212a074:/src/xrc/xmlres.cpp diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 8064dd9470..93a0b7f561 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: xmlres.cpp -// Purpose: XML resources +// Purpose: XRC resources // Author: Vaclav Slavik // Created: 2000/03/05 // RCS-ID: $Id$ @@ -310,7 +310,7 @@ void wxXmlResource::UpdateResources() } else if (m_data[i].Doc->GetRoot()->GetName() != wxT("resource")) { - wxLogError(_("Invalid XML resource '%s': doesn't have root node 'resource'."), m_data[i].File.c_str()); + wxLogError(_("Invalid XRC resource '%s': doesn't have root node 'resource'."), m_data[i].File.c_str()); wxDELETE(m_data[i].Doc); } else @@ -368,7 +368,7 @@ wxXmlNode *wxXmlResource::FindResource(const wxString& name, const wxString& cla } } - wxLogError(_("XML resource '%s' (class '%s') not found!"), + wxLogError(_("XRC resource '%s' (class '%s') not found!"), name.c_str(), classname.c_str()); return NULL; } @@ -494,12 +494,17 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults) wxString wxXmlResourceHandler::GetText(const wxString& param) { - wxString str1 = GetParamValue(param); + wxString str1; wxString str2; const wxChar *dt; wxChar amp_char; - // VS: First version of XML resources used $ instead of & (which is illegal in XML), + if (m_resource->GetUseLocale()) + str1 = wxGetTranslation(GetParamValue(param)); + else + str1 = GetParamValue(param); + + // VS: First version of XRC resources used $ instead of & (which is illegal in XML), // but later I realized that '_' fits this purpose much better (because // &File means "File with F underlined"). if (m_resource->CompareVersion(2,3,0,1) < 0) @@ -529,11 +534,8 @@ wxString wxXmlResourceHandler::GetText(const wxString& param) } else str2 << *dt; } - - if (m_resource->GetUseLocale()) - return wxGetTranslation(str2); - else - return str2; + + return str2; } @@ -601,7 +603,7 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param) if (v.Length() != 7 || v[0u] != wxT('#') || wxSscanf(v.c_str(), wxT("#%lX"), &tmp) != 1) { - wxLogError(_("XML resource: Incorrect colour specification '%s' for property '%s'."), + wxLogError(_("XRC resource: Incorrect colour specification '%s' for property '%s'."), v.c_str(), param.c_str()); return wxNullColour; } @@ -621,7 +623,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param, wxSize size) wxFSFile *fsfile = GetCurFileSystem().OpenFile(name); if (fsfile == NULL) { - wxLogError(_("XML resource: Cannot create bitmap from '%s'."), param.c_str()); + wxLogError(_("XRC resource: Cannot create bitmap from '%s'."), param.c_str()); return wxNullBitmap; } wxImage img(*(fsfile->GetStream())); @@ -631,7 +633,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param, wxSize size) #endif if (!img.Ok()) { - wxLogError(_("XML resource: Cannot create bitmap from '%s'."), param.c_str()); + wxLogError(_("XRC resource: Cannot create bitmap from '%s'."), param.c_str()); return wxNullBitmap; } if (!(size == wxDefaultSize)) img.Rescale(size.x, size.y);