- wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and
wxDocument::GetPrintableName() with GetUserReadableName() which are simpler
to use
+- wxXmlProperty class was renamed to wxXmlAttribute in order to use standard
+ terminology. Corresponding wxXmlNode methods were renamed to use
+ "Attribute" instead of "Property" or "Prop" in their names.
Major new features in this release
\begin{twocollist}\itemsep=0pt
\twocolitem{\helpref{wxXmlDocument}{wxxmldocument}}{A class to parse XML files.}
\twocolitem{\helpref{wxXmlNode}{wxxmlnode}}{A class which represents XML nodes.}
-\twocolitem{\helpref{wxXmlProperty}{wxxmlproperty}}{A class which represents XML properties.}
+\twocolitem{\helpref{wxXmlAttribute}{wxxmlattribute}}{A class which represents XML properties.}
\end{twocollist}
{\large {\bf XML-based resource system classes}}
\input wizpage.tex
\input xmldocument.tex
\input xmlnode.tex
-\input xmlproperty.tex
+\input xmlattr.tex
\input xmlres.tex
\input xmlresh.tex
\input zipstrm.tex
--- /dev/null
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name: xmlnode.tex
+%% Purpose: wxXmlAttribute documentation
+%% Author: Francesco Montorsi
+%% Created: 2006-04-18
+%% RCS-ID: $Id$
+%% Copyright: (c) 2006 Francesco Montorsi
+%% License: wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{\class{wxXmlAttribute}}\label{wxxmlattribute}
+
+Represents a node property.
+
+Example: in {\tt <img src="hello.gif" id="3"/>}, {\tt ``src"} is property with value
+{\tt ``hello.gif"} and {\tt ``id"} is a property with value {\tt ``3"}.
+
+\wxheading{Derived from}
+
+No base class
+
+\wxheading{Include files}
+
+<wx/xml/xml.h>
+
+\wxheading{See also}
+
+\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlNode}{wxxmlnode}
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+
+\membersection{wxXmlAttribute::wxXmlAttribute}\label{wxxmlattributewxxmlattribute}
+
+\func{}{wxXmlAttribute}{\void}
+
+
+\func{}{wxXmlAttribute}{\param{const wxString\& }{name}, \param{const wxString\& }{value}, \param{wxXmlAttribute* }{next = NULL}}
+
+Creates the property with given {\it name} and {\it value}.
+If {\it next} is not NULL, then sets it as sibling of this property.
+
+\membersection{wxXmlAttribute::\destruct{wxXmlAttribute}}\label{wxxmlattributedtor}
+
+\func{}{\destruct{wxXmlAttribute}}{\void}
+
+The virtual destructor.
+
+\membersection{wxXmlAttribute::GetName}\label{wxxmlattributegetname}
+
+\constfunc{wxString}{GetName}{\void}
+
+Returns the name of this property.
+
+\membersection{wxXmlAttribute::GetNext}\label{wxxmlattributegetnext}
+
+\constfunc{wxXmlAttribute*}{GetNext}{\void}
+
+Returns the sibling of this property or NULL if there are no siblings.
+
+\membersection{wxXmlAttribute::GetValue}\label{wxxmlattributegetvalue}
+
+\constfunc{wxString}{GetValue}{\void}
+
+Returns the value of this property.
+
+\membersection{wxXmlAttribute::SetName}\label{wxxmlattributesetname}
+
+\func{void}{SetName}{\param{const wxString\& }{name}}
+
+Sets the name of this property.
+
+\membersection{wxXmlAttribute::SetNext}\label{wxxmlattributesetnext}
+
+\func{void}{SetNext}{\param{wxXmlAttribute* }{next}}
+
+Sets the sibling of this property.
+
+\membersection{wxXmlAttribute::SetValue}\label{wxxmlattributesetvalue}
+
+\func{void}{SetValue}{\param{const wxString\& }{value}}
+
+Sets the value of this property.
+
...
- // process properties of <tag1>
- wxString propvalue1 =
- child->GetPropVal(wxT("prop1"),
+ // process attributes of <tag1>
+ wxString attrvalue1 =
+ child->GetAttribute(wxT("attr1"),
wxT("default-value"));
- wxString propvalue2 =
- child->GetPropVal(wxT("prop2"),
+ wxString attrvalue2 =
+ child->GetAttribute(wxT("attr2"),
wxT("default-value"));
...
\wxheading{See also}
-\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlProperty}{wxxmlproperty}
+\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlAttribute}{wxxmlattribute}
\latexignore{\rtfignore{\wxheading{Members}}}
Returns the version of document.
This is the value in the {\tt <?xml version="1.0"?>} header of the XML document.
-If the version property was not explicitely given in the header, this function
+If the version attribute was not explicitely given in the header, this function
returns an empty string.
Represents a node in an XML document. See \helpref{wxXmlDocument}{wxxmldocument}.
-Node has a name and may have content and properties. Most common node types are
-{\tt wxXML\_TEXT\_NODE} (name and properties are irrelevant) and
+Node has a name and may have content and attributes. Most common node types are
+{\tt wxXML\_TEXT\_NODE} (name and attributes are irrelevant) and
{\tt wxXML\_ELEMENT\_NODE} (e.g. in {\tt <title>hi</title>} there is an element
with name="title", irrelevant content and one child ({\tt wxXML\_TEXT\_NODE}
with content="hi").
\wxheading{See also}
-\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlProperty}{wxxmlproperty}
+\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlAttribute}{wxxmlattribute}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxXmlNode::wxXmlNode}\label{wxxmlnodewxxmlnode}
-\func{}{wxXmlNode}{\param{wxXmlNode* }{parent}, \param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}, \param{wxXmlProperty* }{props = \NULL}, \param{wxXmlNode* }{next = \NULL}}
+\func{}{wxXmlNode}{\param{wxXmlNode* }{parent}, \param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}, \param{wxXmlAttribute* }{attrs = \NULL}, \param{wxXmlNode* }{next = \NULL}}
\wxheading{Parameters}
\docparam{name}{The name of the node. This is the string which appears between angular brackets.}
\docparam{content}{The content of the node. Only meaningful when {\it type} is
{\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}.}
-\docparam{props}{If not \NULL, this \helpref{wxXmlProperty}{wxxmlproperty} object
+\docparam{attrs}{If not \NULL, this \helpref{wxXmlAttribute}{wxxmlattribute} object
and its eventual siblings are attached to the node.}
\docparam{next}{If not \NULL, this node and its eventual siblings are attached to
the node.}
\helpref{GetNext()}{wxxmlnodegetnext} will return \NULL
after using copy ctor and are never unmodified by operator=.
-On the other hand, it DOES copy children and properties.
+On the other hand, it DOES copy children and attributes.
\func{}{wxXmlNode}{\param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}}
\func{}{\destruct{wxXmlNode}}{\void}
-The virtual destructor. Deletes attached children and properties.
+The virtual destructor. Deletes attached children and attributes.
\membersection{wxXmlNode::AddChild}\label{wxxmlnodeaddchild}
Adds the given node as child of this node. To attach a second children to this node, use the
\helpref{SetNext()}{wxxmlnodesetnext} function of the {\it child} node.
-\membersection{wxXmlNode::AddProperty}\label{wxxmlnodeaddproperty}
+\membersection{wxXmlNode::AddAttribute}\label{wxxmlnodeaddattribute}
-\func{void}{AddProperty}{\param{const wxString\& }{name}, \param{const wxString\& }{value}}
+\func{void}{AddAttribute}{\param{const wxString\& }{name}, \param{const wxString\& }{value}}
-Appends a property with given {\it name} and {\it value} to the list of properties for this node.
+Appends a attribute with given {\it name} and {\it value} to the list of attributes for this node.
-\func{void}{AddProperty}{\param{wxXmlProperty* }{prop}}
+\func{void}{AddAttribute}{\param{wxXmlAttribute* }{attr}}
-Appends the given property to the list of properties for this node.
+Appends given attribute to the list of attributes for this node.
-\membersection{wxXmlNode::DeleteProperty}\label{wxxmlnodedeleteproperty}
+\membersection{wxXmlNode::DeleteAttribute}\label{wxxmlnodedeleteattribute}
-\func{bool}{DeleteProperty}{\param{const wxString\& }{name}}
+\func{bool}{DeleteAttribute}{\param{const wxString\& }{name}}
-Removes the first properties which has the given {\it name} from the list of properties for this node.
+Removes the first attributes which has the given {\it name} from the list of attributes for this node.
\membersection{wxXmlNode::GetChildren}\label{wxxmlnodegetchildren}
Returns a pointer to the parent of this node or \NULL if this node has no parent.
-\membersection{wxXmlNode::GetPropVal}\label{wxxmlnodegetpropval}
+\membersection{wxXmlNode::GetAttribute}\label{wxxmlnodegetattribute}
-\constfunc{bool}{GetPropVal}{\param{const wxString\& }{propName}, \param{wxString* }{value}}
+\constfunc{bool}{GetAttribute}{\param{const wxString\& }{attrName}, \param{wxString* }{value}}
-Returns \true if a property named {\it propName} could be found.
-If the {\it value} pointer is not \NULL, the value of that property is saved there.
+Returns \true if a attribute named {\it attrName} could be found.
+If the {\it value} pointer is not \NULL, the value of that attribute is saved there.
-\constfunc{wxString}{GetPropVal}{\param{const wxString\& }{propName}, \param{const wxString\& }{defaultVal}}
+\constfunc{wxString}{GetAttribute}{\param{const wxString\& }{attrName}, \param{const wxString\& }{defaultVal}}
-Returns the value of the property named {\it propName} if it does exist.
+Returns the value of the attribute named {\it attrName} if it does exist.
If it does not exist, the {\it defaultVal} is returned.
-\membersection{wxXmlNode::GetProperties}\label{wxxmlnodegetproperties}
+\membersection{wxXmlNode::GetAttributes}\label{wxxmlnodegetattributes}
-\constfunc{wxXmlProperty *}{GetProperties}{\void}
+\constfunc{wxXmlAttribute *}{GetAttributes}{\void}
-Return a pointer to the first property of this node.
+Return a pointer to the first attribute of this node.
\membersection{wxXmlNode::GetType}\label{wxxmlnodegettype}
Returns the type of this node.
-\membersection{wxXmlNode::HasProp}\label{wxxmlnodehasprop}
+\membersection{wxXmlNode::HasAttribute}\label{wxxmlnodehasattribute}
-\constfunc{bool}{HasProp}{\param{const wxString\& }{propName}}
+\constfunc{bool}{HasAttribute}{\param{const wxString\& }{attrName}}
-Returns \true if this node has a property named {\it propName}.
+Returns \true if this node has a attribute named {\it attrName}.
\membersection{wxXmlNode::InsertChild}\label{wxxmlnodeinsertchild}
Sets as parent the given node. The caller is responsible to delete any previously present
parent node.
-\membersection{wxXmlNode::SetProperties}\label{wxxmlnodesetproperties}
+\membersection{wxXmlNode::SetAttributes}\label{wxxmlnodesetattributes}
-\func{void}{SetProperties}{\param{wxXmlProperty* }{prop}}
+\func{void}{SetAttributes}{\param{wxXmlAttribute* }{attr}}
-Sets as first property the given wxXmlProperty object.
-The caller is responsible to delete any previously present properties attached to this node.
+Sets as first attribute the given wxXmlAttribute object.
+The caller is responsible to delete any previously present attributes attached to this node.
\membersection{wxXmlNode::SetType}\label{wxxmlnodesettype}
+++ /dev/null
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Name: xmlnode.tex
-%% Purpose: wxXmlProperty documentation
-%% Author: Francesco Montorsi
-%% Created: 2006-04-18
-%% RCS-ID: $Id$
-%% Copyright: (c) 2006 Francesco Montorsi
-%% License: wxWindows license
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\section{\class{wxXmlProperty}}\label{wxxmlproperty}
-
-Represents a node property.
-
-Example: in {\tt <img src="hello.gif" id="3"/>}, {\tt ``src"} is property with value
-{\tt ``hello.gif"} and {\tt ``id"} is a property with value {\tt ``3"}.
-
-\wxheading{Derived from}
-
-No base class
-
-\wxheading{Include files}
-
-<wx/xml/xml.h>
-
-\wxheading{See also}
-
-\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlNode}{wxxmlnode}
-
-\latexignore{\rtfignore{\wxheading{Members}}}
-
-
-\membersection{wxXmlProperty::wxXmlProperty}\label{wxxmlpropertywxxmlproperty}
-
-\func{}{wxXmlProperty}{\void}
-
-
-\func{}{wxXmlProperty}{\param{const wxString\& }{name}, \param{const wxString\& }{value}, \param{wxXmlProperty* }{next = NULL}}
-
-Creates the property with given {\it name} and {\it value}.
-If {\it next} is not NULL, then sets it as sibling of this property.
-
-\membersection{wxXmlProperty::\destruct{wxXmlProperty}}\label{wxxmlpropertydtor}
-
-\func{}{\destruct{wxXmlProperty}}{\void}
-
-The virtual destructor.
-
-\membersection{wxXmlProperty::GetName}\label{wxxmlpropertygetname}
-
-\constfunc{wxString}{GetName}{\void}
-
-Returns the name of this property.
-
-\membersection{wxXmlProperty::GetNext}\label{wxxmlpropertygetnext}
-
-\constfunc{wxXmlProperty*}{GetNext}{\void}
-
-Returns the sibling of this property or NULL if there are no siblings.
-
-\membersection{wxXmlProperty::GetValue}\label{wxxmlpropertygetvalue}
-
-\constfunc{wxString}{GetValue}{\void}
-
-Returns the value of this property.
-
-\membersection{wxXmlProperty::SetName}\label{wxxmlpropertysetname}
-
-\func{void}{SetName}{\param{const wxString\& }{name}}
-
-Sets the name of this property.
-
-\membersection{wxXmlProperty::SetNext}\label{wxxmlpropertysetnext}
-
-\func{void}{SetNext}{\param{wxXmlProperty* }{next}}
-
-Sets the sibling of this property.
-
-\membersection{wxXmlProperty::SetValue}\label{wxxmlpropertysetvalue}
-
-\func{void}{SetValue}{\param{const wxString\& }{value}}
-
-Sets the value of this property.
-
#endif
class WXDLLIMPEXP_FWD_XML wxXmlNode;
-class WXDLLIMPEXP_FWD_XML wxXmlProperty;
+class WXDLLIMPEXP_FWD_XML wxXmlAttribute;
class WXDLLIMPEXP_FWD_XML wxXmlDocument;
class WXDLLIMPEXP_FWD_XML wxXmlIOHandler;
class WXDLLIMPEXP_FWD_BASE wxInputStream;
// Example: in <img src="hello.gif" id="3"/> "src" is property with value
// "hello.gif" and "id" is prop. with value "3".
-class WXDLLIMPEXP_XML wxXmlProperty
+class WXDLLIMPEXP_XML wxXmlAttribute
{
public:
- wxXmlProperty() : m_next(NULL) {}
- wxXmlProperty(const wxString& name, const wxString& value,
- wxXmlProperty *next = NULL)
+ wxXmlAttribute() : m_next(NULL) {}
+ wxXmlAttribute(const wxString& name, const wxString& value,
+ wxXmlAttribute *next = NULL)
: m_name(name), m_value(value), m_next(next) {}
- virtual ~wxXmlProperty() {}
+ virtual ~wxXmlAttribute() {}
wxString GetName() const { return m_name; }
wxString GetValue() const { return m_value; }
- wxXmlProperty *GetNext() const { return m_next; }
+ wxXmlAttribute *GetNext() const { return m_next; }
void SetName(const wxString& name) { m_name = name; }
void SetValue(const wxString& value) { m_value = value; }
- void SetNext(wxXmlProperty *next) { m_next = next; }
+ void SetNext(wxXmlAttribute *next) { m_next = next; }
private:
wxString m_name;
wxString m_value;
- wxXmlProperty *m_next;
+ wxXmlAttribute *m_next;
};
+#if WXWIN_COMPATIBILITY_2_8
+ // NB: #define is used instead of typedef so that forward declarations
+ // continue to work
+ #define wxXmlProperty wxXmlAttribute
+#endif
-// Represents node in XML document. Node has name and may have content
-// and properties. Most common node types are wxXML_TEXT_NODE (name and props
+// Represents node in XML document. Node has name and may have content and
+// attributes. Most common node types are wxXML_TEXT_NODE (name and attributes
// are irrelevant) and wxXML_ELEMENT_NODE (e.g. in <title>hi</title> there is
// element with name="title", irrelevant content and one child (wxXML_TEXT_NODE
// with content="hi").
class WXDLLIMPEXP_XML wxXmlNode
{
public:
- wxXmlNode() : m_properties(NULL), m_parent(NULL),
- m_children(NULL), m_next(NULL) {}
+ wxXmlNode()
+ : m_attrs(NULL), m_parent(NULL), m_children(NULL), m_next(NULL) {}
wxXmlNode(wxXmlNode *parent, wxXmlNodeType type,
const wxString& name, const wxString& content = wxEmptyString,
- wxXmlProperty *props = NULL, wxXmlNode *next = NULL);
+ wxXmlAttribute *attrs = NULL, wxXmlNode *next = NULL);
virtual ~wxXmlNode();
// copy ctor & operator=. Note that this does NOT copy syblings
// and parent pointer, i.e. m_parent and m_next will be NULL
// after using copy ctor and are never unmodified by operator=.
- // On the other hand, it DOES copy children and properties.
+ // On the other hand, it DOES copy children and attributes.
wxXmlNode(const wxXmlNode& node);
wxXmlNode& operator=(const wxXmlNode& node);
virtual void AddChild(wxXmlNode *child);
virtual bool InsertChild(wxXmlNode *child, wxXmlNode *before_node);
virtual bool RemoveChild(wxXmlNode *child);
- virtual void AddProperty(const wxString& name, const wxString& value);
- virtual bool DeleteProperty(const wxString& name);
+ virtual void AddAttribute(const wxString& name, const wxString& value)
+ { AddProperty(name, value); }
+ virtual bool DeleteAttribute(const wxString& name)
+ { return DeleteProperty(name); }
// access methods:
wxXmlNodeType GetType() const { return m_type; }
wxXmlNode *GetNext() const { return m_next; }
wxXmlNode *GetChildren() const { return m_children; }
- wxXmlProperty *GetProperties() const { return m_properties; }
- bool GetPropVal(const wxString& propName, wxString *value) const;
- wxString GetPropVal(const wxString& propName,
- const wxString& defaultVal) const;
- bool HasProp(const wxString& propName) const;
+ wxXmlAttribute *GetAttributes() const { return m_attrs; }
+ bool GetAttribute(const wxString& attrName, wxString *value) const;
+ wxString GetAttribute(const wxString& attrName,
+ const wxString& defaultVal) const;
+ bool HasAttribute(const wxString& attrName) const;
void SetType(wxXmlNodeType type) { m_type = type; }
void SetName(const wxString& name) { m_name = name; }
void SetNext(wxXmlNode *next) { m_next = next; }
void SetChildren(wxXmlNode *child) { m_children = child; }
- void SetProperties(wxXmlProperty *prop) { m_properties = prop; }
- virtual void AddProperty(wxXmlProperty *prop);
+ void SetAttributes(wxXmlAttribute *attr) { m_attrs = attr; }
+ virtual void AddAttribute(wxXmlAttribute *attr)
+ { AddProperty(attr); }
+
+#if WXWIN_COMPATIBILITY_2_8
+ wxDEPRECATED( inline wxXmlAttribute *GetProperties() const );
+ wxDEPRECATED( inline bool GetPropVal(const wxString& propName,
+ wxString *value) const );
+ wxDEPRECATED( inline wxString GetPropVal(const wxString& propName,
+ const wxString& defaultVal) const );
+ wxDEPRECATED( inline bool HasProp(const wxString& propName) const );
+
+ wxDEPRECATED( inline void SetProperties(wxXmlAttribute *prop) );
+#endif // WXWIN_COMPATIBILITY_2_8
+
+ // The following three functions are backward compatibility, but because
+ // they were virtual, we must make it possible to override them. This
+ // is done by calling e.g. AddProperty() from AddAttribute(), so we have
+ // to keep AddProperty() even if 2.8 compatibility is off. To prevent
+ // old code from compiling in that case, we make them private and
+ // non-virtual. (This can be removed when WXWIN_COMPATIBILITY_2_8 is
+ // removed, we'll have just *Attribute versions then.)
+#if WXWIN_COMPATIBILITY_2_8
+ wxDEPRECATED_BUT_USED_INTERNALLY(
+ virtual void AddProperty(const wxString& name, const wxString& value) );
+ wxDEPRECATED_BUT_USED_INTERNALLY(
+ virtual bool DeleteProperty(const wxString& name) );
+ wxDEPRECATED_BUT_USED_INTERNALLY(
+ virtual void AddProperty(wxXmlAttribute *attr) );
+#else
+private:
+ void AddProperty(const wxString& name, const wxString& value);
+ bool DeleteProperty(const wxString& name);
+ void AddProperty(wxXmlAttribute *attr);
+#endif // WXWIN_COMPATIBILITY_2_8/!WXWIN_COMPATIBILITY_2_8
private:
wxXmlNodeType m_type;
wxString m_name;
wxString m_content;
- wxXmlProperty *m_properties;
+ wxXmlAttribute *m_attrs;
wxXmlNode *m_parent, *m_children, *m_next;
void DoCopy(const wxXmlNode& node);
};
+#if WXWIN_COMPATIBILITY_2_8
+inline wxXmlAttribute *wxXmlNode::GetProperties() const
+ { return GetAttributes(); }
+inline bool wxXmlNode::GetPropVal(const wxString& propName,
+ wxString *value) const
+ { return GetAttribute(propName, value); }
+inline wxString wxXmlNode::GetPropVal(const wxString& propName,
+ const wxString& defaultVal) const
+ { return GetAttribute(propName, defaultVal); }
+inline bool wxXmlNode::HasProp(const wxString& propName) const
+ { return HasAttribute(propName); }
+inline void wxXmlNode::SetProperties(wxXmlAttribute *prop)
+ { SetAttributes(prop); }
+#endif // WXWIN_COMPATIBILITY_2_8
+
// special indentation value for wxXmlDocument::Save
static inline void
HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- node->AddProperty(name, wxString::Format(_T("%08lx"), value));
+ node->AddAttribute(name, wxString::Format(_T("%08lx"), value));
}
static inline void
NumProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- node->AddProperty(name, wxString::Format(_T("%lu"), value));
+ node->AddAttribute(name, wxString::Format(_T("%lu"), value));
}
static inline void
wxString func = frame.GetName();
if ( !func.empty() )
{
- nodeFrame->AddProperty(_T("function"), func);
+ nodeFrame->AddAttribute(_T("function"), func);
HexProperty(nodeFrame, _T("offset"), frame.GetOffset());
}
if ( frame.HasSourceLocation() )
{
- nodeFrame->AddProperty(_T("file"), frame.GetFileName());
+ nodeFrame->AddAttribute(_T("file"), frame.GetFileName());
NumProperty(nodeFrame, _T("line"), frame.GetLine());
}
bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo)
{
- nodeSystemInfo->AddProperty(_T("description"), wxGetOsDescription());
+ nodeSystemInfo->AddAttribute(_T("description"), wxGetOsDescription());
return true;
}
if ( path.empty() )
path = info.GetName();
if ( !path.empty() )
- nodeModule->AddProperty(_T("path"), path);
+ nodeModule->AddAttribute(_T("path"), path);
void *addr = NULL;
size_t len = 0;
wxString ver = info.GetVersion();
if ( !ver.empty() )
{
- nodeModule->AddProperty(_T("version"), ver);
+ nodeModule->AddAttribute(_T("version"), ver);
}
}
nodeContext->AddChild(nodeExc);
HexProperty(nodeExc, _T("code"), c.code);
- nodeExc->AddProperty(_T("name"), c.GetExceptionString());
+ nodeExc->AddAttribute(_T("name"), c.GetExceptionString());
HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr));
#ifdef __INTEL__
wxXmlDocument xmldoc;
wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report"));
xmldoc.SetRoot(nodeRoot);
- nodeRoot->AddProperty(_T("version"), _T("1.0"));
- nodeRoot->AddProperty(_T("kind"), ctx == Context_Current ? _T("user")
+ nodeRoot->AddAttribute(_T("version"), _T("1.0"));
+ nodeRoot->AddAttribute(_T("kind"), ctx == Context_Current ? _T("user")
: _T("exception"));
// add system information
{
wxXmlNode *pnode;
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("entry"));
- pnode->AddProperty(wxString(wxT("name")), name);
+ pnode->AddAttribute(wxString(wxT("name")), name);
m_data->m_current->AddChild(pnode) ;
m_data->Push( pnode ) ;
}
{
wxXmlNode *pnode;
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
- pnode->AddProperty(wxT("class"), wxString(classInfo->GetClassName()));
- pnode->AddProperty(wxT("id"), wxString::Format( wxT("%d") , objectID ) );
+ pnode->AddAttribute(wxT("class"), wxString(classInfo->GetClassName()));
+ pnode->AddAttribute(wxT("id"), wxString::Format( wxT("%d") , objectID ) );
for ( size_t i = 0 ; i < metadata.GetCount() ; ++i )
{
- pnode->AddProperty( metadata[i].GetName() , metadata[i].GetAsString() ) ;
+ pnode->AddAttribute( metadata[i].GetName() , metadata[i].GetAsString() ) ;
}
m_data->m_current->AddChild(pnode) ;
m_data->Push( pnode ) ;
{
wxXmlNode *pnode;
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("prop") );
- pnode->AddProperty(wxT("name"), pi->GetName() );
+ pnode->AddAttribute(wxT("name"), pi->GetName() );
m_data->m_current->AddChild(pnode) ;
m_data->Push( pnode ) ;
}
{
wxXmlNode *pnode;
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
- pnode->AddProperty(wxString(wxT("href")), wxString::Format( wxT("%d") , objectID ) );
+ pnode->AddAttribute(wxString(wxT("href")), wxString::Format( wxT("%d") , objectID ) );
m_data->m_current->AddChild(pnode) ;
}
if (!children)
{
// check for a null object or href
- if (node->GetPropVal(wxT("href") , &ObjectIdString ) )
+ if (node->GetAttribute(wxT("href") , &ObjectIdString ) )
{
objectID = atoi( ObjectIdString.ToAscii() ) ;
if ( HasObjectClassInfo( objectID ) )
return wxInvalidObjectID ;
}
}
- if ( !node->GetPropVal(wxT("id") , &ObjectIdString ) )
+ if ( !node->GetAttribute(wxT("id") , &ObjectIdString ) )
{
return wxNullObjectID;
}
}
- if (!node->GetPropVal(wxT("class"), &className))
+ if (!node->GetAttribute(wxT("class"), &className))
{
// No class name. Eek. FIXME: error handling
return wxInvalidObjectID;
wxLogError(_("objects cannot have XML Text Nodes") ) ;
return wxInvalidObjectID;
}
- if (!node->GetPropVal(wxT("id"), &ObjectIdString))
+ if (!node->GetAttribute(wxT("id"), &ObjectIdString))
{
wxLogError(_("Objects must have an id attribute") ) ;
// No object id. Eek. FIXME: error handling
SetObjectClassInfo( objectID , classInfo ) ;
wxxVariantArray metadata ;
- wxXmlProperty *xp = node->GetProperties() ;
+ wxXmlAttribute *xp = node->GetAttributes() ;
while ( xp )
{
if ( xp->GetName() != wxString(wxT("class")) && xp->GetName() != wxString(wxT("id")) )
while( children )
{
wxString name ;
- children->GetPropVal( wxT("name") , &name ) ;
+ children->GetAttribute( wxT("name") , &name ) ;
propertyNames.push_back( (const wxChar*)name.c_str() ) ;
propertyNodes[(const wxChar*)name.c_str()] = children->GetChildren() ;
children = children->GetNext() ;
while ( iter )
{
wxString entryName ;
- if ( iter->GetPropVal(wxT("name"), &entryName) )
+ if ( iter->GetAttribute(wxT("name"), &entryName) )
{
if ( entryName == name )
return ReadComponent( iter->GetChildren() , callbacks ) ;
if (name == wxT("paragraphlayout"))
{
- wxString partial = node->GetPropVal(wxT("partialparagraph"), wxEmptyString);
+ wxString partial = node->GetAttribute(wxT("partialparagraph"), wxEmptyString);
if (partial == wxT("true"))
buffer->SetPartialParagraph(true);
}
else if (childName == wxT("image"))
{
int imageType = wxBITMAP_TYPE_PNG;
- wxString value = node->GetPropVal(wxT("imagetype"), wxEmptyString);
+ wxString value = node->GetAttribute(wxT("imagetype"), wxEmptyString);
if (!value.empty())
imageType = wxAtoi(value);
if (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET)
{
wxRichTextStyleSheet* sheet = new wxRichTextStyleSheet;
- wxString sheetName = node->GetPropVal(wxT("name"), wxEmptyString);
- wxString sheetDescription = node->GetPropVal(wxT("description"), wxEmptyString);
+ wxString sheetName = node->GetAttribute(wxT("name"), wxEmptyString);
+ wxString sheetDescription = node->GetAttribute(wxT("description"), wxEmptyString);
sheet->SetName(sheetName);
sheet->SetDescription(sheetDescription);
bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node)
{
wxString styleType = node->GetName();
- wxString styleName = node->GetPropVal(wxT("name"), wxEmptyString);
- wxString baseStyleName = node->GetPropVal(wxT("basestyle"), wxEmptyString);
+ wxString styleName = node->GetAttribute(wxT("name"), wxEmptyString);
+ wxString baseStyleName = node->GetAttribute(wxT("basestyle"), wxEmptyString);
if (styleName.IsEmpty())
return false;
{
wxRichTextParagraphStyleDefinition* def = new wxRichTextParagraphStyleDefinition(styleName);
- wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString);
+ wxString nextStyleName = node->GetAttribute(wxT("nextstyle"), wxEmptyString);
def->SetNextStyle(nextStyleName);
def->SetBaseStyle(baseStyleName);
{
wxRichTextListStyleDefinition* def = new wxRichTextListStyleDefinition(styleName);
- wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString);
+ wxString nextStyleName = node->GetAttribute(wxT("nextstyle"), wxEmptyString);
def->SetNextStyle(nextStyleName);
def->SetBaseStyle(baseStyleName);
wxTextAttrEx attr;
GetStyle(attr, child, false);
- wxString styleLevel = child->GetPropVal(wxT("level"), wxEmptyString);
+ wxString styleLevel = child->GetAttribute(wxT("level"), wxEmptyString);
if (styleLevel.IsEmpty())
{
def->SetStyle(attr);
int fontFlags = 0;
- fontFacename = node->GetPropVal(wxT("fontface"), wxEmptyString);
+ fontFacename = node->GetAttribute(wxT("fontface"), wxEmptyString);
if (!fontFacename.IsEmpty())
fontFlags |= wxTEXT_ATTR_FONT_FACE;
wxString value;
- //value = node->GetPropVal(wxT("fontfamily"), wxEmptyString);
+ //value = node->GetAttribute(wxT("fontfamily"), wxEmptyString);
//if (!value.empty())
// fontFamily = wxAtoi(value);
- value = node->GetPropVal(wxT("fontstyle"), wxEmptyString);
+ value = node->GetAttribute(wxT("fontstyle"), wxEmptyString);
if (!value.empty())
{
fontStyle = wxAtoi(value);
fontFlags |= wxTEXT_ATTR_FONT_ITALIC;
}
- value = node->GetPropVal(wxT("fontsize"), wxEmptyString);
+ value = node->GetAttribute(wxT("fontsize"), wxEmptyString);
if (!value.empty())
{
fontSize = wxAtoi(value);
fontFlags |= wxTEXT_ATTR_FONT_SIZE;
}
- value = node->GetPropVal(wxT("fontweight"), wxEmptyString);
+ value = node->GetAttribute(wxT("fontweight"), wxEmptyString);
if (!value.empty())
{
fontWeight = wxAtoi(value);
fontFlags |= wxTEXT_ATTR_FONT_WEIGHT;
}
- value = node->GetPropVal(wxT("fontunderlined"), wxEmptyString);
+ value = node->GetAttribute(wxT("fontunderlined"), wxEmptyString);
if (!value.empty())
{
fontUnderlined = wxAtoi(value) != 0;
// Restore correct font flags
attr.SetFlags(fontFlags);
- value = node->GetPropVal(wxT("textcolor"), wxEmptyString);
+ value = node->GetAttribute(wxT("textcolor"), wxEmptyString);
if (!value.empty())
{
if (value[0] == wxT('#'))
attr.SetTextColour(value);
}
- value = node->GetPropVal(wxT("backgroundcolor"), wxEmptyString);
+ value = node->GetAttribute(wxT("backgroundcolor"), wxEmptyString);
if (!value.empty())
{
if (value[0] == wxT('#'))
attr.SetBackgroundColour(value);
}
- value = node->GetPropVal(wxT("characterstyle"), wxEmptyString);
+ value = node->GetAttribute(wxT("characterstyle"), wxEmptyString);
if (!value.empty())
attr.SetCharacterStyleName(value);
- value = node->GetPropVal(wxT("texteffects"), wxEmptyString);
+ value = node->GetAttribute(wxT("texteffects"), wxEmptyString);
if (!value.IsEmpty())
{
attr.SetTextEffects(wxAtoi(value));
}
- value = node->GetPropVal(wxT("texteffectflags"), wxEmptyString);
+ value = node->GetAttribute(wxT("texteffectflags"), wxEmptyString);
if (!value.IsEmpty())
{
attr.SetTextEffectFlags(wxAtoi(value));
// Set paragraph attributes
if (isPara)
{
- value = node->GetPropVal(wxT("alignment"), wxEmptyString);
+ value = node->GetAttribute(wxT("alignment"), wxEmptyString);
if (!value.empty())
attr.SetAlignment((wxTextAttrAlignment) wxAtoi(value));
int leftIndent = 0;
bool hasLeftIndent = false;
- value = node->GetPropVal(wxT("leftindent"), wxEmptyString);
+ value = node->GetAttribute(wxT("leftindent"), wxEmptyString);
if (!value.empty())
{
leftIndent = wxAtoi(value);
hasLeftIndent = true;
}
- value = node->GetPropVal(wxT("leftsubindent"), wxEmptyString);
+ value = node->GetAttribute(wxT("leftsubindent"), wxEmptyString);
if (!value.empty())
{
leftSubIndent = wxAtoi(value);
if (hasLeftIndent)
attr.SetLeftIndent(leftIndent, leftSubIndent);
- value = node->GetPropVal(wxT("rightindent"), wxEmptyString);
+ value = node->GetAttribute(wxT("rightindent"), wxEmptyString);
if (!value.empty())
attr.SetRightIndent(wxAtoi(value));
- value = node->GetPropVal(wxT("parspacingbefore"), wxEmptyString);
+ value = node->GetAttribute(wxT("parspacingbefore"), wxEmptyString);
if (!value.empty())
attr.SetParagraphSpacingBefore(wxAtoi(value));
- value = node->GetPropVal(wxT("parspacingafter"), wxEmptyString);
+ value = node->GetAttribute(wxT("parspacingafter"), wxEmptyString);
if (!value.empty())
attr.SetParagraphSpacingAfter(wxAtoi(value));
- value = node->GetPropVal(wxT("linespacing"), wxEmptyString);
+ value = node->GetAttribute(wxT("linespacing"), wxEmptyString);
if (!value.empty())
attr.SetLineSpacing(wxAtoi(value));
- value = node->GetPropVal(wxT("bulletstyle"), wxEmptyString);
+ value = node->GetAttribute(wxT("bulletstyle"), wxEmptyString);
if (!value.empty())
attr.SetBulletStyle(wxAtoi(value));
- value = node->GetPropVal(wxT("bulletnumber"), wxEmptyString);
+ value = node->GetAttribute(wxT("bulletnumber"), wxEmptyString);
if (!value.empty())
attr.SetBulletNumber(wxAtoi(value));
- value = node->GetPropVal(wxT("bulletsymbol"), wxEmptyString);
+ value = node->GetAttribute(wxT("bulletsymbol"), wxEmptyString);
if (!value.empty())
{
wxChar ch = wxAtoi(value);
attr.SetBulletText(s);
}
- value = node->GetPropVal(wxT("bullettext"), wxEmptyString);
+ value = node->GetAttribute(wxT("bullettext"), wxEmptyString);
if (!value.empty())
attr.SetBulletText(value);
- value = node->GetPropVal(wxT("bulletfont"), wxEmptyString);
+ value = node->GetAttribute(wxT("bulletfont"), wxEmptyString);
if (!value.empty())
attr.SetBulletFont(value);
- value = node->GetPropVal(wxT("bulletname"), wxEmptyString);
+ value = node->GetAttribute(wxT("bulletname"), wxEmptyString);
if (!value.empty())
attr.SetBulletName(value);
- value = node->GetPropVal(wxT("url"), wxEmptyString);
+ value = node->GetAttribute(wxT("url"), wxEmptyString);
if (!value.empty())
attr.SetURL(value);
- value = node->GetPropVal(wxT("parstyle"), wxEmptyString);
+ value = node->GetAttribute(wxT("parstyle"), wxEmptyString);
if (!value.empty())
attr.SetParagraphStyleName(value);
- value = node->GetPropVal(wxT("liststyle"), wxEmptyString);
+ value = node->GetAttribute(wxT("liststyle"), wxEmptyString);
if (!value.empty())
attr.SetListStyleName(value);
- value = node->GetPropVal(wxT("tabs"), wxEmptyString);
+ value = node->GetAttribute(wxT("tabs"), wxEmptyString);
if (!value.empty())
{
wxArrayInt tabs;
attr.SetTabs(tabs);
}
- value = node->GetPropVal(wxT("pagebreak"), wxEmptyString);
+ value = node->GetAttribute(wxT("pagebreak"), wxEmptyString);
if (!value.IsEmpty())
{
attr.SetPageBreak(wxAtoi(value) != 0);
}
- value = node->GetPropVal(wxT("outlinelevel"), wxEmptyString);
+ value = node->GetAttribute(wxT("outlinelevel"), wxEmptyString);
if (!value.IsEmpty())
{
attr.SetOutlineLevel(wxAtoi(value) != 0);
wxXmlNode::wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
const wxString& name, const wxString& content,
- wxXmlProperty *props, wxXmlNode *next)
+ wxXmlAttribute *attrs, wxXmlNode *next)
: m_type(type), m_name(name), m_content(content),
- m_properties(props), m_parent(parent),
+ m_attrs(attrs), m_parent(parent),
m_children(NULL), m_next(next)
{
if (m_parent)
wxXmlNode::wxXmlNode(wxXmlNodeType type, const wxString& name,
const wxString& content)
: m_type(type), m_name(name), m_content(content),
- m_properties(NULL), m_parent(NULL),
+ m_attrs(NULL), m_parent(NULL),
m_children(NULL), m_next(NULL)
{}
delete c;
}
- wxXmlProperty *p, *p2;
- for (p = m_properties; p; p = p2)
+ wxXmlAttribute *p, *p2;
+ for (p = m_attrs; p; p = p2)
{
p2 = p->GetNext();
delete p;
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
{
- wxDELETE(m_properties);
+ wxDELETE(m_attrs);
wxDELETE(m_children);
DoCopy(node);
return *this;
n = n->GetNext();
}
- m_properties = NULL;
- wxXmlProperty *p = node.m_properties;
+ m_attrs = NULL;
+ wxXmlAttribute *p = node.m_attrs;
while (p)
{
- AddProperty(p->GetName(), p->GetValue());
+ AddAttribute(p->GetName(), p->GetValue());
p = p->GetNext();
}
}
-bool wxXmlNode::HasProp(const wxString& propName) const
+bool wxXmlNode::HasAttribute(const wxString& attrName) const
{
- wxXmlProperty *prop = GetProperties();
+ wxXmlAttribute *attr = GetAttributes();
- while (prop)
+ while (attr)
{
- if (prop->GetName() == propName) return true;
- prop = prop->GetNext();
+ if (attr->GetName() == attrName) return true;
+ attr = attr->GetNext();
}
return false;
}
-bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const
+bool wxXmlNode::GetAttribute(const wxString& attrName, wxString *value) const
{
- wxXmlProperty *prop = GetProperties();
+ wxXmlAttribute *attr = GetAttributes();
- while (prop)
+ while (attr)
{
- if (prop->GetName() == propName)
+ if (attr->GetName() == attrName)
{
- *value = prop->GetValue();
+ *value = attr->GetValue();
return true;
}
- prop = prop->GetNext();
+ attr = attr->GetNext();
}
return false;
}
-wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const
+wxString wxXmlNode::GetAttribute(const wxString& attrName, const wxString& defaultVal) const
{
wxString tmp;
- if (GetPropVal(propName, &tmp))
+ if (GetAttribute(attrName, &tmp))
return tmp;
return defaultVal;
void wxXmlNode::AddProperty(const wxString& name, const wxString& value)
{
- AddProperty(new wxXmlProperty(name, value, NULL));
+ AddProperty(new wxXmlAttribute(name, value, NULL));
}
-void wxXmlNode::AddProperty(wxXmlProperty *prop)
+void wxXmlNode::AddProperty(wxXmlAttribute *attr)
{
- if (m_properties == NULL)
- m_properties = prop;
+ if (m_attrs == NULL)
+ m_attrs = attr;
else
{
- wxXmlProperty *p = m_properties;
+ wxXmlAttribute *p = m_attrs;
while (p->GetNext()) p = p->GetNext();
- p->SetNext(prop);
+ p->SetNext(attr);
}
}
bool wxXmlNode::DeleteProperty(const wxString& name)
{
- wxXmlProperty *prop;
+ wxXmlAttribute *attr;
- if (m_properties == NULL)
+ if (m_attrs == NULL)
return false;
- else if (m_properties->GetName() == name)
+ else if (m_attrs->GetName() == name)
{
- prop = m_properties;
- m_properties = prop->GetNext();
- prop->SetNext(NULL);
- delete prop;
+ attr = m_attrs;
+ m_attrs = attr->GetNext();
+ attr->SetNext(NULL);
+ delete attr;
return true;
}
else
{
- wxXmlProperty *p = m_properties;
+ wxXmlAttribute *p = m_attrs;
while (p->GetNext())
{
if (p->GetNext()->GetName() == name)
{
- prop = p->GetNext();
- p->SetNext(prop->GetNext());
- prop->SetNext(NULL);
- delete prop;
+ attr = p->GetNext();
+ p->SetNext(attr->GetNext());
+ attr->SetNext(NULL);
+ delete attr;
return true;
}
p = p->GetNext();
const char **a = atts;
while (*a)
{
- node->AddProperty(CharToString(ctx->conv, a[0]), CharToString(ctx->conv, a[1]));
+ node->AddAttribute(CharToString(ctx->conv, a[0]), CharToString(ctx->conv, a[1]));
a += 2;
}
if (ctx->root == NULL)
wxMBConv *convMem, wxMBConv *convFile, int indentstep)
{
wxXmlNode *n, *prev;
- wxXmlProperty *prop;
+ wxXmlAttribute *attr;
switch (node->GetType())
{
OutputString(stream, wxT("<"));
OutputString(stream, node->GetName());
- prop = node->GetProperties();
- while (prop)
+ attr = node->GetAttributes();
+ while (attr)
{
- OutputString(stream, wxT(" ") + prop->GetName() + wxT("=\""));
- OutputStringEnt(stream, prop->GetValue(), convMem, convFile,
+ OutputString(stream, wxT(" ") + attr->GetName() + wxT("=\""));
+ OutputStringEnt(stream, attr->GetValue(), convMem, convFile,
XML_ESCAPE_QUOTES);
OutputString(stream, wxT("\""));
- prop = prop->GetNext();
+ attr = attr->GetNext();
}
if (node->GetChildren())
{ n = n->GetNext(); continue; }
// checking boolean is a bit ugly here (see GetBool() )
- wxString v = n->GetPropVal(wxT("checked"), wxEmptyString);
+ wxString v = n->GetAttribute(wxT("checked"), wxEmptyString);
v.MakeLower();
if (v == wxT("1"))
control->Check( i, true );
#else
// Avoid GCC bug - this fails on certain GCC 3.3 and 3.4 builds for an unknown reason
-// it is believed to be related to the fact IsOfClass is inline, and node->GetPropVal
+// it is believed to be related to the fact IsOfClass is inline, and node->GetAttribute
// gets passed an invalid "this" pointer. On 2.7, the function is out of line, so the
// above should work fine. This code is left in here so this file can easily be used
// in a version backported to 2.6. All we are doing here is expanding the macro
- bool fOurClass = node->GetPropVal(wxT("class"), wxEmptyString) == wxT("wxOwnerDrawnComboBox");
+ bool fOurClass = node->GetAttribute(wxT("class"), wxEmptyString) == wxT("wxOwnerDrawnComboBox");
return (fOurClass ||
(m_insideBox && node->GetName() == wxT("item")));
#endif
wxString str = GetNodeContent(m_node);
wxString tooltip;
- m_node->GetPropVal(wxT("tooltip"), &tooltip);
+ m_node->GetAttribute(wxT("tooltip"), &tooltip);
wxString helptext;
- bool hasHelptext = m_node->GetPropVal(wxT("helptext"), &helptext);
+ bool hasHelptext = m_node->GetAttribute(wxT("helptext"), &helptext);
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
{
while (c)
{
isok = false;
- if (!c->GetPropVal(wxT("platform"), &s))
+ if (!c->GetAttribute(wxT("platform"), &s))
isok = true;
else
{
{
long version;
int v1, v2, v3, v4;
- wxString verstr = m_data[i].Doc->GetRoot()->GetPropVal(
+ wxString verstr = m_data[i].Doc->GetRoot()->GetAttribute(
wxT("version"), wxT("0.0.0.0"));
if (wxSscanf(verstr.c_str(), wxT("%i.%i.%i.%i"),
&v1, &v2, &v3, &v4) == 4)
if ( node->GetType() == wxXML_ELEMENT_NODE &&
(node->GetName() == wxT("object") ||
node->GetName() == wxT("object_ref")) &&
- node->GetPropVal(wxT("name"), &dummy) && dummy == name )
+ node->GetAttribute(wxT("name"), &dummy) && dummy == name )
{
- wxString cls(node->GetPropVal(wxT("class"), wxEmptyString));
+ wxString cls(node->GetAttribute(wxT("class"), wxEmptyString));
if (!classname || cls == classname)
return node;
- // object_ref may not have 'class' property:
+ // object_ref may not have 'class' attribute:
if (cls.empty() && node->GetName() == wxT("object_ref"))
{
- wxString refName = node->GetPropVal(wxT("ref"), wxEmptyString);
+ wxString refName = node->GetAttribute(wxT("ref"), wxEmptyString);
if (refName.empty())
continue;
wxXmlNode* refNode = FindResource(refName, wxEmptyString, true);
if (refNode &&
- refNode->GetPropVal(wxT("class"), wxEmptyString) == classname)
+ refNode->GetAttribute(wxT("class"), wxEmptyString) == classname)
{
return node;
}
static void MergeNodes(wxXmlNode& dest, wxXmlNode& with)
{
- // Merge properties:
- for (wxXmlProperty *prop = with.GetProperties(); prop; prop = prop->GetNext())
+ // Merge attributes:
+ for ( wxXmlAttribute *attr = with.GetAttributes();
+ attr; attr = attr->GetNext() )
{
- wxXmlProperty *dprop;
- for (dprop = dest.GetProperties(); dprop; dprop = dprop->GetNext())
+ wxXmlAttribute *dattr;
+ for (dattr = dest.GetAttributes(); dattr; dattr = dattr->GetNext())
{
- if ( dprop->GetName() == prop->GetName() )
+ if ( dattr->GetName() == attr->GetName() )
{
- dprop->SetValue(prop->GetValue());
+ dattr->SetValue(attr->GetValue());
break;
}
}
- if ( !dprop )
- dest.AddProperty(prop->GetName(), prop->GetValue());
+ if ( !dattr )
+ dest.AddAttribute(attr->GetName(), attr->GetValue());
}
// Merge child nodes:
for (wxXmlNode* node = with.GetChildren(); node; node = node->GetNext())
{
- wxString name = node->GetPropVal(wxT("name"), wxEmptyString);
+ wxString name = node->GetAttribute(wxT("name"), wxEmptyString);
wxXmlNode *dnode;
for (dnode = dest.GetChildren(); dnode; dnode = dnode->GetNext() )
{
if ( dnode->GetName() == node->GetName() &&
- dnode->GetPropVal(wxT("name"), wxEmptyString) == name &&
+ dnode->GetAttribute(wxT("name"), wxEmptyString) == name &&
dnode->GetType() == node->GetType() )
{
MergeNodes(*dnode, *node);
if ( !dnode )
{
static const wxChar *AT_END = wxT("end");
- wxString insert_pos = node->GetPropVal(wxT("insert_at"), AT_END);
+ wxString insert_pos = node->GetAttribute(wxT("insert_at"), AT_END);
if ( insert_pos == AT_END )
{
dest.AddChild(new wxXmlNode(*node));
// handling of referenced resource
if ( node->GetName() == wxT("object_ref") )
{
- wxString refName = node->GetPropVal(wxT("ref"), wxEmptyString);
+ wxString refName = node->GetAttribute(wxT("ref"), wxEmptyString);
wxXmlNode* refNode = FindResource(refName, wxEmptyString, true);
if ( !refNode )
wxLogError(_("No handler found for XML node '%s', class '%s'!"),
node->GetName().c_str(),
- node->GetPropVal(wxT("class"), wxEmptyString).c_str());
+ node->GetAttribute(wxT("class"), wxEmptyString).c_str());
return NULL;
}
wxWindow *myParentAW = m_parentAsWindow;
m_instance = instance;
- if (!m_instance && node->HasProp(wxT("subclass")) &&
+ if (!m_instance && node->HasAttribute(wxT("subclass")) &&
!(m_resource->GetFlags() & wxXRC_NO_SUBCLASSING))
{
- wxString subclass = node->GetPropVal(wxT("subclass"), wxEmptyString);
+ wxString subclass = node->GetAttribute(wxT("subclass"), wxEmptyString);
if (!subclass.empty())
{
for (wxXmlSubclassFactoriesList::compatibility_iterator i = wxXmlResource::ms_subclassFactories->GetFirst();
if (!m_instance)
{
- wxString name = node->GetPropVal(wxT("name"), wxEmptyString);
+ wxString name = node->GetAttribute(wxT("name"), wxEmptyString);
wxLogError(_("Subclass '%s' not found for resource '%s', not subclassing!"),
subclass.c_str(), name.c_str());
}
}
m_node = node;
- m_class = node->GetPropVal(wxT("class"), wxEmptyString);
+ m_class = node->GetAttribute(wxT("class"), wxEmptyString);
m_parent = parent;
m_parentAsWindow = wxDynamicCast(m_parent, wxWindow);
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
{
if (translate && parNode &&
- parNode->GetPropVal(wxT("translate"), wxEmptyString) != wxT("0"))
+ parNode->GetAttribute(wxT("translate"), wxEmptyString) != wxT("0"))
{
return wxGetTranslation(str2, m_resource->GetDomain());
}
wxString wxXmlResourceHandler::GetName()
{
- return m_node->GetPropVal(wxT("name"), wxT("-1"));
+ return m_node->GetAttribute(wxT("name"), wxT("-1"));
}
if (clr.Ok())
return clr;
- wxLogError(_("XRC resource: Incorrect colour specification '%s' for property '%s'."),
+ wxLogError(_("XRC resource: Incorrect colour specification '%s' for attribute '%s'."),
v.c_str(), param.c_str());
return wxNullColour;
}
wxXmlNode *bmpNode = GetParamNode(param);
if ( bmpNode )
{
- wxString sid = bmpNode->GetPropVal(wxT("stock_id"), wxEmptyString);
+ wxString sid = bmpNode->GetAttribute(wxT("stock_id"), wxEmptyString);
if ( !sid.empty() )
{
- wxString scl = bmpNode->GetPropVal(wxT("stock_client"), wxEmptyString);
+ wxString scl = bmpNode->GetAttribute(wxT("stock_client"), wxEmptyString);
if (scl.empty())
scl = defaultArtClient;
else
bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
{
- return node->GetPropVal(wxT("class"), wxEmptyString) == classname;
+ return node->GetAttribute(wxT("class"), wxEmptyString) == classname;
}
while (node)
{
if (node->GetName() == _T("object")
- && node->GetPropVal(_T("class"),&classValue)
- && node->GetPropVal(_T("name"),&nameValue))
+ && node->GetAttribute(_T("class"),&classValue)
+ && node->GetAttribute(_T("name"),&nameValue))
{
m_wdata.Add(XRCWidgetData(nameValue,classValue));
}
wxString classValue,nameValue;
while(node){
if(node->GetName() == _T("object")
- && node->GetPropVal(_T("class"),&classValue)
- && node->GetPropVal(_T("name"),&nameValue)){
+ && node->GetAttribute(_T("class"),&classValue)
+ && node->GetAttribute(_T("name"),&nameValue)){
aXRCWndClassData.Add(
XRCWndClassData(nameValue,classValue,node)
// wxBitmapButton:
wxXmlNode *parent = node->GetParent();
if (parent != NULL &&
- parent->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
+ parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") &&
(name == _T("focus") ||
name == _T("disabled") ||
name == _T("selected")))
// wxBitmap or wxIcon toplevel resources:
if ( name == _T("object") )
{
- wxString klass = node->GetPropVal(_T("class"), wxEmptyString);
+ wxString klass = node->GetAttribute(_T("class"), wxEmptyString);
if (klass == _T("wxBitmap") ||
klass == _T("wxIcon") ||
klass == _T("data") )
// URLs in wxHtmlWindow:
if ( name == _T("url") &&
parent != NULL &&
- parent->GetPropVal(_T("class"), _T("")) == _T("wxHtmlWindow") )
+ parent->GetAttribute(_T("class"), _T("")) == _T("wxHtmlWindow") )
{
// FIXME: this is wrong for e.g. http:// URLs
return true;
// ...and known to contain translatable string
{
if (!flagGettext ||
- node->GetPropVal(_T("translate"), _T("1")) != _T("0"))
+ node->GetAttribute(_T("translate"), _T("1")) != _T("0"))
{
arr.Add(ConvertText(n->GetContent()));
}