#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/bitmap.h"
+ #include "wx/image.h"
+ #include "wx/module.h"
#endif
#ifndef __WXWINCE__
#include "wx/filename.h"
#include "wx/tokenzr.h"
#include "wx/fontenum.h"
-#include "wx/module.h"
-#include "wx/image.h"
#include "wx/fontmap.h"
#include "wx/artprov.h"
return old;
}
-wxXmlResource::wxXmlResource(int flags)
+wxXmlResource::wxXmlResource(int flags, const wxString& domain)
{
m_flags = flags;
m_version = -1;
+ m_domain = NULL;
+ if (! domain.empty() )
+ SetDomain(domain);
}
-wxXmlResource::wxXmlResource(const wxString& filemask, int flags)
+wxXmlResource::wxXmlResource(const wxString& filemask, int flags, const wxString& domain)
{
m_flags = flags;
m_version = -1;
+ m_domain = NULL;
+ if (! domain.empty() )
+ SetDomain(domain);
Load(filemask);
}
wxXmlResource::~wxXmlResource()
{
+ if (m_domain)
+ free(m_domain);
ClearHandlers();
}
+void wxXmlResource::SetDomain(const wxChar* domain)
+{
+ if (m_domain)
+ free(m_domain);
+ m_domain = NULL;
+ if (domain && wxStrlen(domain))
+ m_domain = wxStrdup(domain);
+}
+
/* static */
wxString wxXmlResource::ConvertFileNameToURL(const wxString& filename)
if (translate && parNode &&
parNode->GetPropVal(wxT("translate"), wxEmptyString) != wxT("0"))
{
- return wxGetTranslation(str2);
+ return wxGetTranslation(str2, m_resource->GetDomain());
}
else
{
return wxNullColour;
}
-wxColour wxXmlResourceHandler::GetColour(const wxString& param)
+wxColour wxXmlResourceHandler::GetColour(const wxString& param, const wxColour& defaultv)
{
wxString v = GetParamValue(param);
+
+ if ( v.empty() )
+ return defaultv;
+
wxColour clr;
// wxString -> wxColour conversion
}
+
+bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
+{
+ return node->GetPropVal(wxT("class"), wxEmptyString) == classname;
+}
+
+
+
wxString wxXmlResourceHandler::GetNodeContent(wxXmlNode *node)
{
wxXmlNode *n = node;
stdID(wxID_HELP);
stdID(wxID_PRINT);
stdID(wxID_PRINT_SETUP);
+ stdID(wxID_PAGE_SETUP);
stdID(wxID_PREVIEW);
stdID(wxID_ABOUT);
stdID(wxID_HELP_CONTENTS);