renamed wxXmlProperty to wxXmlAttribute, plus implied method names changes (bug #1751761)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -92,6 +92,9 @@ Deprecated methods and their replacements
|
|||||||
- wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and
|
- wxDocManager::MakeDefaultName() replaced by MakeNewDocumentName() and
|
||||||
wxDocument::GetPrintableName() with GetUserReadableName() which are simpler
|
wxDocument::GetPrintableName() with GetUserReadableName() which are simpler
|
||||||
to use
|
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
|
Major new features in this release
|
||||||
|
@@ -648,7 +648,7 @@ used internally by the HTML classes.
|
|||||||
\begin{twocollist}\itemsep=0pt
|
\begin{twocollist}\itemsep=0pt
|
||||||
\twocolitem{\helpref{wxXmlDocument}{wxxmldocument}}{A class to parse XML files.}
|
\twocolitem{\helpref{wxXmlDocument}{wxxmldocument}}{A class to parse XML files.}
|
||||||
\twocolitem{\helpref{wxXmlNode}{wxxmlnode}}{A class which represents XML nodes.}
|
\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}
|
\end{twocollist}
|
||||||
|
|
||||||
{\large {\bf XML-based resource system classes}}
|
{\large {\bf XML-based resource system classes}}
|
||||||
|
@@ -453,7 +453,7 @@
|
|||||||
\input wizpage.tex
|
\input wizpage.tex
|
||||||
\input xmldocument.tex
|
\input xmldocument.tex
|
||||||
\input xmlnode.tex
|
\input xmlnode.tex
|
||||||
\input xmlproperty.tex
|
\input xmlattr.tex
|
||||||
\input xmlres.tex
|
\input xmlres.tex
|
||||||
\input xmlresh.tex
|
\input xmlresh.tex
|
||||||
\input zipstrm.tex
|
\input zipstrm.tex
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%% Name: xmlnode.tex
|
%% Name: xmlnode.tex
|
||||||
%% Purpose: wxXmlProperty documentation
|
%% Purpose: wxXmlAttribute documentation
|
||||||
%% Author: Francesco Montorsi
|
%% Author: Francesco Montorsi
|
||||||
%% Created: 2006-04-18
|
%% Created: 2006-04-18
|
||||||
%% RCS-ID: $Id$
|
%% RCS-ID: $Id$
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
%% License: wxWindows license
|
%% License: wxWindows license
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
\section{\class{wxXmlProperty}}\label{wxxmlproperty}
|
\section{\class{wxXmlAttribute}}\label{wxxmlattribute}
|
||||||
|
|
||||||
Represents a node property.
|
Represents a node property.
|
||||||
|
|
||||||
@@ -30,53 +30,53 @@ No base class
|
|||||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
|
|
||||||
|
|
||||||
\membersection{wxXmlProperty::wxXmlProperty}\label{wxxmlpropertywxxmlproperty}
|
\membersection{wxXmlAttribute::wxXmlAttribute}\label{wxxmlattributewxxmlattribute}
|
||||||
|
|
||||||
\func{}{wxXmlProperty}{\void}
|
\func{}{wxXmlAttribute}{\void}
|
||||||
|
|
||||||
|
|
||||||
\func{}{wxXmlProperty}{\param{const wxString\& }{name}, \param{const wxString\& }{value}, \param{wxXmlProperty* }{next = NULL}}
|
\func{}{wxXmlAttribute}{\param{const wxString\& }{name}, \param{const wxString\& }{value}, \param{wxXmlAttribute* }{next = NULL}}
|
||||||
|
|
||||||
Creates the property with given {\it name} and {\it value}.
|
Creates the property with given {\it name} and {\it value}.
|
||||||
If {\it next} is not NULL, then sets it as sibling of this property.
|
If {\it next} is not NULL, then sets it as sibling of this property.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::\destruct{wxXmlProperty}}\label{wxxmlpropertydtor}
|
\membersection{wxXmlAttribute::\destruct{wxXmlAttribute}}\label{wxxmlattributedtor}
|
||||||
|
|
||||||
\func{}{\destruct{wxXmlProperty}}{\void}
|
\func{}{\destruct{wxXmlAttribute}}{\void}
|
||||||
|
|
||||||
The virtual destructor.
|
The virtual destructor.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::GetName}\label{wxxmlpropertygetname}
|
\membersection{wxXmlAttribute::GetName}\label{wxxmlattributegetname}
|
||||||
|
|
||||||
\constfunc{wxString}{GetName}{\void}
|
\constfunc{wxString}{GetName}{\void}
|
||||||
|
|
||||||
Returns the name of this property.
|
Returns the name of this property.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::GetNext}\label{wxxmlpropertygetnext}
|
\membersection{wxXmlAttribute::GetNext}\label{wxxmlattributegetnext}
|
||||||
|
|
||||||
\constfunc{wxXmlProperty*}{GetNext}{\void}
|
\constfunc{wxXmlAttribute*}{GetNext}{\void}
|
||||||
|
|
||||||
Returns the sibling of this property or NULL if there are no siblings.
|
Returns the sibling of this property or NULL if there are no siblings.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::GetValue}\label{wxxmlpropertygetvalue}
|
\membersection{wxXmlAttribute::GetValue}\label{wxxmlattributegetvalue}
|
||||||
|
|
||||||
\constfunc{wxString}{GetValue}{\void}
|
\constfunc{wxString}{GetValue}{\void}
|
||||||
|
|
||||||
Returns the value of this property.
|
Returns the value of this property.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::SetName}\label{wxxmlpropertysetname}
|
\membersection{wxXmlAttribute::SetName}\label{wxxmlattributesetname}
|
||||||
|
|
||||||
\func{void}{SetName}{\param{const wxString\& }{name}}
|
\func{void}{SetName}{\param{const wxString\& }{name}}
|
||||||
|
|
||||||
Sets the name of this property.
|
Sets the name of this property.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::SetNext}\label{wxxmlpropertysetnext}
|
\membersection{wxXmlAttribute::SetNext}\label{wxxmlattributesetnext}
|
||||||
|
|
||||||
\func{void}{SetNext}{\param{wxXmlProperty* }{next}}
|
\func{void}{SetNext}{\param{wxXmlAttribute* }{next}}
|
||||||
|
|
||||||
Sets the sibling of this property.
|
Sets the sibling of this property.
|
||||||
|
|
||||||
\membersection{wxXmlProperty::SetValue}\label{wxxmlpropertysetvalue}
|
\membersection{wxXmlAttribute::SetValue}\label{wxxmlattributesetvalue}
|
||||||
|
|
||||||
\func{void}{SetValue}{\param{const wxString\& }{value}}
|
\func{void}{SetValue}{\param{const wxString\& }{value}}
|
||||||
|
|
@@ -36,12 +36,12 @@ while (child) {
|
|||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
// process properties of <tag1>
|
// process attributes of <tag1>
|
||||||
wxString propvalue1 =
|
wxString attrvalue1 =
|
||||||
child->GetPropVal(wxT("prop1"),
|
child->GetAttribute(wxT("attr1"),
|
||||||
wxT("default-value"));
|
wxT("default-value"));
|
||||||
wxString propvalue2 =
|
wxString attrvalue2 =
|
||||||
child->GetPropVal(wxT("prop2"),
|
child->GetAttribute(wxT("attr2"),
|
||||||
wxT("default-value"));
|
wxT("default-value"));
|
||||||
|
|
||||||
...
|
...
|
||||||
@@ -86,7 +86,7 @@ doc.Save(wxT("myfile2.xml")); // myfile2.xml != myfile.xml
|
|||||||
|
|
||||||
\wxheading{See also}
|
\wxheading{See also}
|
||||||
|
|
||||||
\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlProperty}{wxxmlproperty}
|
\helpref{wxXmlNode}{wxxmlnode}, \helpref{wxXmlAttribute}{wxxmlattribute}
|
||||||
|
|
||||||
|
|
||||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
@@ -166,7 +166,7 @@ Returns the root node of the document.
|
|||||||
|
|
||||||
Returns the version of document.
|
Returns the version of document.
|
||||||
This is the value in the {\tt <?xml version="1.0"?>} header of the XML 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.
|
returns an empty string.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
Represents a node in an XML document. See \helpref{wxXmlDocument}{wxxmldocument}.
|
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
|
Node has a name and may have content and attributes. Most common node types are
|
||||||
{\tt wxXML\_TEXT\_NODE} (name and properties are irrelevant) and
|
{\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
|
{\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 name="title", irrelevant content and one child ({\tt wxXML\_TEXT\_NODE}
|
||||||
with content="hi").
|
with content="hi").
|
||||||
@@ -57,7 +57,7 @@ enum wxXmlNodeType
|
|||||||
|
|
||||||
\wxheading{See also}
|
\wxheading{See also}
|
||||||
|
|
||||||
\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlProperty}{wxxmlproperty}
|
\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlAttribute}{wxxmlattribute}
|
||||||
|
|
||||||
|
|
||||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||||
@@ -65,7 +65,7 @@ enum wxXmlNodeType
|
|||||||
|
|
||||||
\membersection{wxXmlNode::wxXmlNode}\label{wxxmlnodewxxmlnode}
|
\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}
|
\wxheading{Parameters}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ constructor and it shouldn't be done again.}
|
|||||||
\docparam{name}{The name of the node. This is the string which appears between angular brackets.}
|
\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
|
\docparam{content}{The content of the node. Only meaningful when {\it type} is
|
||||||
{\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}.}
|
{\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.}
|
and its eventual siblings are attached to the node.}
|
||||||
\docparam{next}{If not \NULL, this node and its eventual siblings are attached to
|
\docparam{next}{If not \NULL, this node and its eventual siblings are attached to
|
||||||
the node.}
|
the node.}
|
||||||
@@ -92,7 +92,7 @@ and parent pointer, i.e. \helpref{GetParent()}{wxxmlnodegetparent} and
|
|||||||
\helpref{GetNext()}{wxxmlnodegetnext} will return \NULL
|
\helpref{GetNext()}{wxxmlnodegetnext} will return \NULL
|
||||||
after using copy ctor and are never unmodified by operator=.
|
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{}{wxXmlNode}{\param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}}
|
||||||
@@ -104,7 +104,7 @@ A simplified version of the first constructor form, assuming a \NULL parent.
|
|||||||
|
|
||||||
\func{}{\destruct{wxXmlNode}}{\void}
|
\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}
|
\membersection{wxXmlNode::AddChild}\label{wxxmlnodeaddchild}
|
||||||
|
|
||||||
@@ -113,21 +113,21 @@ The virtual destructor. Deletes attached children and properties.
|
|||||||
Adds the given node as child of this node. To attach a second children to this node, use the
|
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.
|
\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}
|
\membersection{wxXmlNode::GetChildren}\label{wxxmlnodegetchildren}
|
||||||
|
|
||||||
@@ -198,23 +198,23 @@ Returns a pointer to the sibling of this node or \NULL if there are no siblings.
|
|||||||
|
|
||||||
Returns a pointer to the parent of this node or \NULL if this node has no parent.
|
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.
|
Returns \true if a attribute named {\it attrName} could be found.
|
||||||
If the {\it value} pointer is not \NULL, the value of that property is saved there.
|
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.
|
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}
|
\membersection{wxXmlNode::GetType}\label{wxxmlnodegettype}
|
||||||
|
|
||||||
@@ -223,11 +223,11 @@ Return a pointer to the first property of this node.
|
|||||||
Returns the type of this node.
|
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}
|
\membersection{wxXmlNode::InsertChild}\label{wxxmlnodeinsertchild}
|
||||||
|
|
||||||
@@ -288,12 +288,12 @@ sibling node.
|
|||||||
Sets as parent the given node. The caller is responsible to delete any previously present
|
Sets as parent the given node. The caller is responsible to delete any previously present
|
||||||
parent node.
|
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.
|
Sets as first attribute the given wxXmlAttribute object.
|
||||||
The caller is responsible to delete any previously present properties attached to this node.
|
The caller is responsible to delete any previously present attributes attached to this node.
|
||||||
|
|
||||||
\membersection{wxXmlNode::SetType}\label{wxxmlnodesettype}
|
\membersection{wxXmlNode::SetType}\label{wxxmlnodesettype}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_XML wxXmlNode;
|
class WXDLLIMPEXP_FWD_XML wxXmlNode;
|
||||||
class WXDLLIMPEXP_FWD_XML wxXmlProperty;
|
class WXDLLIMPEXP_FWD_XML wxXmlAttribute;
|
||||||
class WXDLLIMPEXP_FWD_XML wxXmlDocument;
|
class WXDLLIMPEXP_FWD_XML wxXmlDocument;
|
||||||
class WXDLLIMPEXP_FWD_XML wxXmlIOHandler;
|
class WXDLLIMPEXP_FWD_XML wxXmlIOHandler;
|
||||||
class WXDLLIMPEXP_FWD_BASE wxInputStream;
|
class WXDLLIMPEXP_FWD_BASE wxInputStream;
|
||||||
@@ -60,33 +60,38 @@ enum wxXmlNodeType
|
|||||||
// Example: in <img src="hello.gif" id="3"/> "src" is property with value
|
// Example: in <img src="hello.gif" id="3"/> "src" is property with value
|
||||||
// "hello.gif" and "id" is prop. with value "3".
|
// "hello.gif" and "id" is prop. with value "3".
|
||||||
|
|
||||||
class WXDLLIMPEXP_XML wxXmlProperty
|
class WXDLLIMPEXP_XML wxXmlAttribute
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxXmlProperty() : m_next(NULL) {}
|
wxXmlAttribute() : m_next(NULL) {}
|
||||||
wxXmlProperty(const wxString& name, const wxString& value,
|
wxXmlAttribute(const wxString& name, const wxString& value,
|
||||||
wxXmlProperty *next = NULL)
|
wxXmlAttribute *next = NULL)
|
||||||
: m_name(name), m_value(value), m_next(next) {}
|
: m_name(name), m_value(value), m_next(next) {}
|
||||||
virtual ~wxXmlProperty() {}
|
virtual ~wxXmlAttribute() {}
|
||||||
|
|
||||||
wxString GetName() const { return m_name; }
|
wxString GetName() const { return m_name; }
|
||||||
wxString GetValue() const { return m_value; }
|
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 SetName(const wxString& name) { m_name = name; }
|
||||||
void SetValue(const wxString& value) { m_value = value; }
|
void SetValue(const wxString& value) { m_value = value; }
|
||||||
void SetNext(wxXmlProperty *next) { m_next = next; }
|
void SetNext(wxXmlAttribute *next) { m_next = next; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
wxString m_value;
|
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
|
// Represents node in XML document. Node has name and may have content and
|
||||||
// and properties. Most common node types are wxXML_TEXT_NODE (name and props
|
// 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
|
// 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
|
// element with name="title", irrelevant content and one child (wxXML_TEXT_NODE
|
||||||
// with content="hi").
|
// with content="hi").
|
||||||
@@ -97,17 +102,17 @@ private:
|
|||||||
class WXDLLIMPEXP_XML wxXmlNode
|
class WXDLLIMPEXP_XML wxXmlNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxXmlNode() : m_properties(NULL), m_parent(NULL),
|
wxXmlNode()
|
||||||
m_children(NULL), m_next(NULL) {}
|
: m_attrs(NULL), m_parent(NULL), m_children(NULL), m_next(NULL) {}
|
||||||
wxXmlNode(wxXmlNode *parent, wxXmlNodeType type,
|
wxXmlNode(wxXmlNode *parent, wxXmlNodeType type,
|
||||||
const wxString& name, const wxString& content = wxEmptyString,
|
const wxString& name, const wxString& content = wxEmptyString,
|
||||||
wxXmlProperty *props = NULL, wxXmlNode *next = NULL);
|
wxXmlAttribute *attrs = NULL, wxXmlNode *next = NULL);
|
||||||
virtual ~wxXmlNode();
|
virtual ~wxXmlNode();
|
||||||
|
|
||||||
// copy ctor & operator=. Note that this does NOT copy syblings
|
// copy ctor & operator=. Note that this does NOT copy syblings
|
||||||
// and parent pointer, i.e. m_parent and m_next will be NULL
|
// and parent pointer, i.e. m_parent and m_next will be NULL
|
||||||
// after using copy ctor and are never unmodified by operator=.
|
// 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(const wxXmlNode& node);
|
||||||
wxXmlNode& operator=(const wxXmlNode& node);
|
wxXmlNode& operator=(const wxXmlNode& node);
|
||||||
|
|
||||||
@@ -117,8 +122,10 @@ public:
|
|||||||
virtual void AddChild(wxXmlNode *child);
|
virtual void AddChild(wxXmlNode *child);
|
||||||
virtual bool InsertChild(wxXmlNode *child, wxXmlNode *before_node);
|
virtual bool InsertChild(wxXmlNode *child, wxXmlNode *before_node);
|
||||||
virtual bool RemoveChild(wxXmlNode *child);
|
virtual bool RemoveChild(wxXmlNode *child);
|
||||||
virtual void AddProperty(const wxString& name, const wxString& value);
|
virtual void AddAttribute(const wxString& name, const wxString& value)
|
||||||
virtual bool DeleteProperty(const wxString& name);
|
{ AddProperty(name, value); }
|
||||||
|
virtual bool DeleteAttribute(const wxString& name)
|
||||||
|
{ return DeleteProperty(name); }
|
||||||
|
|
||||||
// access methods:
|
// access methods:
|
||||||
wxXmlNodeType GetType() const { return m_type; }
|
wxXmlNodeType GetType() const { return m_type; }
|
||||||
@@ -139,11 +146,11 @@ public:
|
|||||||
wxXmlNode *GetNext() const { return m_next; }
|
wxXmlNode *GetNext() const { return m_next; }
|
||||||
wxXmlNode *GetChildren() const { return m_children; }
|
wxXmlNode *GetChildren() const { return m_children; }
|
||||||
|
|
||||||
wxXmlProperty *GetProperties() const { return m_properties; }
|
wxXmlAttribute *GetAttributes() const { return m_attrs; }
|
||||||
bool GetPropVal(const wxString& propName, wxString *value) const;
|
bool GetAttribute(const wxString& attrName, wxString *value) const;
|
||||||
wxString GetPropVal(const wxString& propName,
|
wxString GetAttribute(const wxString& attrName,
|
||||||
const wxString& defaultVal) const;
|
const wxString& defaultVal) const;
|
||||||
bool HasProp(const wxString& propName) const;
|
bool HasAttribute(const wxString& attrName) const;
|
||||||
|
|
||||||
void SetType(wxXmlNodeType type) { m_type = type; }
|
void SetType(wxXmlNodeType type) { m_type = type; }
|
||||||
void SetName(const wxString& name) { m_name = name; }
|
void SetName(const wxString& name) { m_name = name; }
|
||||||
@@ -153,19 +160,67 @@ public:
|
|||||||
void SetNext(wxXmlNode *next) { m_next = next; }
|
void SetNext(wxXmlNode *next) { m_next = next; }
|
||||||
void SetChildren(wxXmlNode *child) { m_children = child; }
|
void SetChildren(wxXmlNode *child) { m_children = child; }
|
||||||
|
|
||||||
void SetProperties(wxXmlProperty *prop) { m_properties = prop; }
|
void SetAttributes(wxXmlAttribute *attr) { m_attrs = attr; }
|
||||||
virtual void AddProperty(wxXmlProperty *prop);
|
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:
|
private:
|
||||||
wxXmlNodeType m_type;
|
wxXmlNodeType m_type;
|
||||||
wxString m_name;
|
wxString m_name;
|
||||||
wxString m_content;
|
wxString m_content;
|
||||||
wxXmlProperty *m_properties;
|
wxXmlAttribute *m_attrs;
|
||||||
wxXmlNode *m_parent, *m_children, *m_next;
|
wxXmlNode *m_parent, *m_children, *m_next;
|
||||||
|
|
||||||
void DoCopy(const wxXmlNode& node);
|
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
|
// special indentation value for wxXmlDocument::Save
|
||||||
|
@@ -87,13 +87,13 @@ protected:
|
|||||||
static inline void
|
static inline void
|
||||||
HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
|
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
|
static inline void
|
||||||
NumProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
|
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
|
static inline void
|
||||||
@@ -129,13 +129,13 @@ void XmlStackWalker::OnStackFrame(const wxStackFrame& frame)
|
|||||||
wxString func = frame.GetName();
|
wxString func = frame.GetName();
|
||||||
if ( !func.empty() )
|
if ( !func.empty() )
|
||||||
{
|
{
|
||||||
nodeFrame->AddProperty(_T("function"), func);
|
nodeFrame->AddAttribute(_T("function"), func);
|
||||||
HexProperty(nodeFrame, _T("offset"), frame.GetOffset());
|
HexProperty(nodeFrame, _T("offset"), frame.GetOffset());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( frame.HasSourceLocation() )
|
if ( frame.HasSourceLocation() )
|
||||||
{
|
{
|
||||||
nodeFrame->AddProperty(_T("file"), frame.GetFileName());
|
nodeFrame->AddAttribute(_T("file"), frame.GetFileName());
|
||||||
NumProperty(nodeFrame, _T("line"), frame.GetLine());
|
NumProperty(nodeFrame, _T("line"), frame.GetLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ void wxDebugReport::AddAll(Context context)
|
|||||||
|
|
||||||
bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo)
|
bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo)
|
||||||
{
|
{
|
||||||
nodeSystemInfo->AddProperty(_T("description"), wxGetOsDescription());
|
nodeSystemInfo->AddAttribute(_T("description"), wxGetOsDescription());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -371,7 +371,7 @@ bool wxDebugReport::DoAddLoadedModules(wxXmlNode *nodeModules)
|
|||||||
if ( path.empty() )
|
if ( path.empty() )
|
||||||
path = info.GetName();
|
path = info.GetName();
|
||||||
if ( !path.empty() )
|
if ( !path.empty() )
|
||||||
nodeModule->AddProperty(_T("path"), path);
|
nodeModule->AddAttribute(_T("path"), path);
|
||||||
|
|
||||||
void *addr = NULL;
|
void *addr = NULL;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
@@ -384,7 +384,7 @@ bool wxDebugReport::DoAddLoadedModules(wxXmlNode *nodeModules)
|
|||||||
wxString ver = info.GetVersion();
|
wxString ver = info.GetVersion();
|
||||||
if ( !ver.empty() )
|
if ( !ver.empty() )
|
||||||
{
|
{
|
||||||
nodeModule->AddProperty(_T("version"), ver);
|
nodeModule->AddAttribute(_T("version"), ver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ bool wxDebugReport::DoAddExceptionInfo(wxXmlNode *nodeContext)
|
|||||||
nodeContext->AddChild(nodeExc);
|
nodeContext->AddChild(nodeExc);
|
||||||
|
|
||||||
HexProperty(nodeExc, _T("code"), c.code);
|
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));
|
HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr));
|
||||||
|
|
||||||
#ifdef __INTEL__
|
#ifdef __INTEL__
|
||||||
@@ -445,8 +445,8 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx)
|
|||||||
wxXmlDocument xmldoc;
|
wxXmlDocument xmldoc;
|
||||||
wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report"));
|
wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report"));
|
||||||
xmldoc.SetRoot(nodeRoot);
|
xmldoc.SetRoot(nodeRoot);
|
||||||
nodeRoot->AddProperty(_T("version"), _T("1.0"));
|
nodeRoot->AddAttribute(_T("version"), _T("1.0"));
|
||||||
nodeRoot->AddProperty(_T("kind"), ctx == Context_Current ? _T("user")
|
nodeRoot->AddAttribute(_T("kind"), ctx == Context_Current ? _T("user")
|
||||||
: _T("exception"));
|
: _T("exception"));
|
||||||
|
|
||||||
// add system information
|
// add system information
|
||||||
|
@@ -94,7 +94,7 @@ void wxXmlWriter::DoBeginWriteTopLevelEntry( const wxString &name )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("entry"));
|
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->m_current->AddChild(pnode) ;
|
||||||
m_data->Push( pnode ) ;
|
m_data->Push( pnode ) ;
|
||||||
}
|
}
|
||||||
@@ -108,12 +108,12 @@ void wxXmlWriter::DoBeginWriteObject(const wxObject *WXUNUSED(object), const wxC
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
||||||
pnode->AddProperty(wxT("class"), wxString(classInfo->GetClassName()));
|
pnode->AddAttribute(wxT("class"), wxString(classInfo->GetClassName()));
|
||||||
pnode->AddProperty(wxT("id"), wxString::Format( wxT("%d") , objectID ) );
|
pnode->AddAttribute(wxT("id"), wxString::Format( wxT("%d") , objectID ) );
|
||||||
|
|
||||||
for ( size_t i = 0 ; i < metadata.GetCount() ; ++i )
|
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->m_current->AddChild(pnode) ;
|
||||||
m_data->Push( pnode ) ;
|
m_data->Push( pnode ) ;
|
||||||
@@ -148,7 +148,7 @@ void wxXmlWriter::DoBeginWriteProperty(const wxPropertyInfo *pi )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("prop") );
|
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->m_current->AddChild(pnode) ;
|
||||||
m_data->Push( pnode ) ;
|
m_data->Push( pnode ) ;
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ void wxXmlWriter::DoWriteRepeatedObject( int objectID )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
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) ;
|
m_data->m_current->AddChild(pnode) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
|
|||||||
if (!children)
|
if (!children)
|
||||||
{
|
{
|
||||||
// check for a null object or href
|
// check for a null object or href
|
||||||
if (node->GetPropVal(wxT("href") , &ObjectIdString ) )
|
if (node->GetAttribute(wxT("href") , &ObjectIdString ) )
|
||||||
{
|
{
|
||||||
objectID = atoi( ObjectIdString.ToAscii() ) ;
|
objectID = atoi( ObjectIdString.ToAscii() ) ;
|
||||||
if ( HasObjectClassInfo( objectID ) )
|
if ( HasObjectClassInfo( objectID ) )
|
||||||
@@ -233,12 +233,12 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
|
|||||||
return wxInvalidObjectID ;
|
return wxInvalidObjectID ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !node->GetPropVal(wxT("id") , &ObjectIdString ) )
|
if ( !node->GetAttribute(wxT("id") , &ObjectIdString ) )
|
||||||
{
|
{
|
||||||
return wxNullObjectID;
|
return wxNullObjectID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!node->GetPropVal(wxT("class"), &className))
|
if (!node->GetAttribute(wxT("class"), &className))
|
||||||
{
|
{
|
||||||
// No class name. Eek. FIXME: error handling
|
// No class name. Eek. FIXME: error handling
|
||||||
return wxInvalidObjectID;
|
return wxInvalidObjectID;
|
||||||
@@ -255,7 +255,7 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
|
|||||||
wxLogError(_("objects cannot have XML Text Nodes") ) ;
|
wxLogError(_("objects cannot have XML Text Nodes") ) ;
|
||||||
return wxInvalidObjectID;
|
return wxInvalidObjectID;
|
||||||
}
|
}
|
||||||
if (!node->GetPropVal(wxT("id"), &ObjectIdString))
|
if (!node->GetAttribute(wxT("id"), &ObjectIdString))
|
||||||
{
|
{
|
||||||
wxLogError(_("Objects must have an id attribute") ) ;
|
wxLogError(_("Objects must have an id attribute") ) ;
|
||||||
// No object id. Eek. FIXME: error handling
|
// No object id. Eek. FIXME: error handling
|
||||||
@@ -274,7 +274,7 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
|
|||||||
SetObjectClassInfo( objectID , classInfo ) ;
|
SetObjectClassInfo( objectID , classInfo ) ;
|
||||||
|
|
||||||
wxxVariantArray metadata ;
|
wxxVariantArray metadata ;
|
||||||
wxXmlProperty *xp = node->GetProperties() ;
|
wxXmlAttribute *xp = node->GetAttributes() ;
|
||||||
while ( xp )
|
while ( xp )
|
||||||
{
|
{
|
||||||
if ( xp->GetName() != wxString(wxT("class")) && xp->GetName() != wxString(wxT("id")) )
|
if ( xp->GetName() != wxString(wxT("class")) && xp->GetName() != wxString(wxT("id")) )
|
||||||
@@ -305,7 +305,7 @@ int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks)
|
|||||||
while( children )
|
while( children )
|
||||||
{
|
{
|
||||||
wxString name ;
|
wxString name ;
|
||||||
children->GetPropVal( wxT("name") , &name ) ;
|
children->GetAttribute( wxT("name") , &name ) ;
|
||||||
propertyNames.push_back( (const wxChar*)name.c_str() ) ;
|
propertyNames.push_back( (const wxChar*)name.c_str() ) ;
|
||||||
propertyNodes[(const wxChar*)name.c_str()] = children->GetChildren() ;
|
propertyNodes[(const wxChar*)name.c_str()] = children->GetChildren() ;
|
||||||
children = children->GetNext() ;
|
children = children->GetNext() ;
|
||||||
@@ -525,7 +525,7 @@ int wxXmlReader::ReadObject( const wxString &name , wxDepersister *callbacks)
|
|||||||
while ( iter )
|
while ( iter )
|
||||||
{
|
{
|
||||||
wxString entryName ;
|
wxString entryName ;
|
||||||
if ( iter->GetPropVal(wxT("name"), &entryName) )
|
if ( iter->GetAttribute(wxT("name"), &entryName) )
|
||||||
{
|
{
|
||||||
if ( entryName == name )
|
if ( entryName == name )
|
||||||
return ReadComponent( iter->GetChildren() , callbacks ) ;
|
return ReadComponent( iter->GetChildren() , callbacks ) ;
|
||||||
|
@@ -101,7 +101,7 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
|||||||
|
|
||||||
if (name == wxT("paragraphlayout"))
|
if (name == wxT("paragraphlayout"))
|
||||||
{
|
{
|
||||||
wxString partial = node->GetPropVal(wxT("partialparagraph"), wxEmptyString);
|
wxString partial = node->GetAttribute(wxT("partialparagraph"), wxEmptyString);
|
||||||
if (partial == wxT("true"))
|
if (partial == wxT("true"))
|
||||||
buffer->SetPartialParagraph(true);
|
buffer->SetPartialParagraph(true);
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
|||||||
else if (childName == wxT("image"))
|
else if (childName == wxT("image"))
|
||||||
{
|
{
|
||||||
int imageType = wxBITMAP_TYPE_PNG;
|
int imageType = wxBITMAP_TYPE_PNG;
|
||||||
wxString value = node->GetPropVal(wxT("imagetype"), wxEmptyString);
|
wxString value = node->GetAttribute(wxT("imagetype"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
imageType = wxAtoi(value);
|
imageType = wxAtoi(value);
|
||||||
|
|
||||||
@@ -217,8 +217,8 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
|||||||
if (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET)
|
if (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET)
|
||||||
{
|
{
|
||||||
wxRichTextStyleSheet* sheet = new wxRichTextStyleSheet;
|
wxRichTextStyleSheet* sheet = new wxRichTextStyleSheet;
|
||||||
wxString sheetName = node->GetPropVal(wxT("name"), wxEmptyString);
|
wxString sheetName = node->GetAttribute(wxT("name"), wxEmptyString);
|
||||||
wxString sheetDescription = node->GetPropVal(wxT("description"), wxEmptyString);
|
wxString sheetDescription = node->GetAttribute(wxT("description"), wxEmptyString);
|
||||||
sheet->SetName(sheetName);
|
sheet->SetName(sheetName);
|
||||||
sheet->SetDescription(sheetDescription);
|
sheet->SetDescription(sheetDescription);
|
||||||
|
|
||||||
@@ -254,8 +254,8 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)
|
|||||||
bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node)
|
bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node)
|
||||||
{
|
{
|
||||||
wxString styleType = node->GetName();
|
wxString styleType = node->GetName();
|
||||||
wxString styleName = node->GetPropVal(wxT("name"), wxEmptyString);
|
wxString styleName = node->GetAttribute(wxT("name"), wxEmptyString);
|
||||||
wxString baseStyleName = node->GetPropVal(wxT("basestyle"), wxEmptyString);
|
wxString baseStyleName = node->GetAttribute(wxT("basestyle"), wxEmptyString);
|
||||||
|
|
||||||
if (styleName.IsEmpty())
|
if (styleName.IsEmpty())
|
||||||
return false;
|
return false;
|
||||||
@@ -283,7 +283,7 @@ bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wx
|
|||||||
{
|
{
|
||||||
wxRichTextParagraphStyleDefinition* def = new wxRichTextParagraphStyleDefinition(styleName);
|
wxRichTextParagraphStyleDefinition* def = new wxRichTextParagraphStyleDefinition(styleName);
|
||||||
|
|
||||||
wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString);
|
wxString nextStyleName = node->GetAttribute(wxT("nextstyle"), wxEmptyString);
|
||||||
def->SetNextStyle(nextStyleName);
|
def->SetNextStyle(nextStyleName);
|
||||||
def->SetBaseStyle(baseStyleName);
|
def->SetBaseStyle(baseStyleName);
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wx
|
|||||||
{
|
{
|
||||||
wxRichTextListStyleDefinition* def = new wxRichTextListStyleDefinition(styleName);
|
wxRichTextListStyleDefinition* def = new wxRichTextListStyleDefinition(styleName);
|
||||||
|
|
||||||
wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString);
|
wxString nextStyleName = node->GetAttribute(wxT("nextstyle"), wxEmptyString);
|
||||||
def->SetNextStyle(nextStyleName);
|
def->SetNextStyle(nextStyleName);
|
||||||
def->SetBaseStyle(baseStyleName);
|
def->SetBaseStyle(baseStyleName);
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wx
|
|||||||
wxTextAttrEx attr;
|
wxTextAttrEx attr;
|
||||||
GetStyle(attr, child, false);
|
GetStyle(attr, child, false);
|
||||||
|
|
||||||
wxString styleLevel = child->GetPropVal(wxT("level"), wxEmptyString);
|
wxString styleLevel = child->GetAttribute(wxT("level"), wxEmptyString);
|
||||||
if (styleLevel.IsEmpty())
|
if (styleLevel.IsEmpty())
|
||||||
{
|
{
|
||||||
def->SetStyle(attr);
|
def->SetStyle(attr);
|
||||||
@@ -1020,37 +1020,37 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
|
|
||||||
int fontFlags = 0;
|
int fontFlags = 0;
|
||||||
|
|
||||||
fontFacename = node->GetPropVal(wxT("fontface"), wxEmptyString);
|
fontFacename = node->GetAttribute(wxT("fontface"), wxEmptyString);
|
||||||
if (!fontFacename.IsEmpty())
|
if (!fontFacename.IsEmpty())
|
||||||
fontFlags |= wxTEXT_ATTR_FONT_FACE;
|
fontFlags |= wxTEXT_ATTR_FONT_FACE;
|
||||||
|
|
||||||
wxString value;
|
wxString value;
|
||||||
//value = node->GetPropVal(wxT("fontfamily"), wxEmptyString);
|
//value = node->GetAttribute(wxT("fontfamily"), wxEmptyString);
|
||||||
//if (!value.empty())
|
//if (!value.empty())
|
||||||
// fontFamily = wxAtoi(value);
|
// fontFamily = wxAtoi(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("fontstyle"), wxEmptyString);
|
value = node->GetAttribute(wxT("fontstyle"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
fontStyle = wxAtoi(value);
|
fontStyle = wxAtoi(value);
|
||||||
fontFlags |= wxTEXT_ATTR_FONT_ITALIC;
|
fontFlags |= wxTEXT_ATTR_FONT_ITALIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("fontsize"), wxEmptyString);
|
value = node->GetAttribute(wxT("fontsize"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
fontSize = wxAtoi(value);
|
fontSize = wxAtoi(value);
|
||||||
fontFlags |= wxTEXT_ATTR_FONT_SIZE;
|
fontFlags |= wxTEXT_ATTR_FONT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("fontweight"), wxEmptyString);
|
value = node->GetAttribute(wxT("fontweight"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
fontWeight = wxAtoi(value);
|
fontWeight = wxAtoi(value);
|
||||||
fontFlags |= wxTEXT_ATTR_FONT_WEIGHT;
|
fontFlags |= wxTEXT_ATTR_FONT_WEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("fontunderlined"), wxEmptyString);
|
value = node->GetAttribute(wxT("fontunderlined"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
fontUnderlined = wxAtoi(value) != 0;
|
fontUnderlined = wxAtoi(value) != 0;
|
||||||
@@ -1065,7 +1065,7 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
// Restore correct font flags
|
// Restore correct font flags
|
||||||
attr.SetFlags(fontFlags);
|
attr.SetFlags(fontFlags);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("textcolor"), wxEmptyString);
|
value = node->GetAttribute(wxT("textcolor"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
if (value[0] == wxT('#'))
|
if (value[0] == wxT('#'))
|
||||||
@@ -1074,7 +1074,7 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
attr.SetTextColour(value);
|
attr.SetTextColour(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("backgroundcolor"), wxEmptyString);
|
value = node->GetAttribute(wxT("backgroundcolor"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
if (value[0] == wxT('#'))
|
if (value[0] == wxT('#'))
|
||||||
@@ -1083,17 +1083,17 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
attr.SetBackgroundColour(value);
|
attr.SetBackgroundColour(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("characterstyle"), wxEmptyString);
|
value = node->GetAttribute(wxT("characterstyle"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetCharacterStyleName(value);
|
attr.SetCharacterStyleName(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("texteffects"), wxEmptyString);
|
value = node->GetAttribute(wxT("texteffects"), wxEmptyString);
|
||||||
if (!value.IsEmpty())
|
if (!value.IsEmpty())
|
||||||
{
|
{
|
||||||
attr.SetTextEffects(wxAtoi(value));
|
attr.SetTextEffects(wxAtoi(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("texteffectflags"), wxEmptyString);
|
value = node->GetAttribute(wxT("texteffectflags"), wxEmptyString);
|
||||||
if (!value.IsEmpty())
|
if (!value.IsEmpty())
|
||||||
{
|
{
|
||||||
attr.SetTextEffectFlags(wxAtoi(value));
|
attr.SetTextEffectFlags(wxAtoi(value));
|
||||||
@@ -1102,7 +1102,7 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
// Set paragraph attributes
|
// Set paragraph attributes
|
||||||
if (isPara)
|
if (isPara)
|
||||||
{
|
{
|
||||||
value = node->GetPropVal(wxT("alignment"), wxEmptyString);
|
value = node->GetAttribute(wxT("alignment"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetAlignment((wxTextAttrAlignment) wxAtoi(value));
|
attr.SetAlignment((wxTextAttrAlignment) wxAtoi(value));
|
||||||
|
|
||||||
@@ -1110,14 +1110,14 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
int leftIndent = 0;
|
int leftIndent = 0;
|
||||||
bool hasLeftIndent = false;
|
bool hasLeftIndent = false;
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("leftindent"), wxEmptyString);
|
value = node->GetAttribute(wxT("leftindent"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
leftIndent = wxAtoi(value);
|
leftIndent = wxAtoi(value);
|
||||||
hasLeftIndent = true;
|
hasLeftIndent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("leftsubindent"), wxEmptyString);
|
value = node->GetAttribute(wxT("leftsubindent"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
leftSubIndent = wxAtoi(value);
|
leftSubIndent = wxAtoi(value);
|
||||||
@@ -1127,31 +1127,31 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
if (hasLeftIndent)
|
if (hasLeftIndent)
|
||||||
attr.SetLeftIndent(leftIndent, leftSubIndent);
|
attr.SetLeftIndent(leftIndent, leftSubIndent);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("rightindent"), wxEmptyString);
|
value = node->GetAttribute(wxT("rightindent"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetRightIndent(wxAtoi(value));
|
attr.SetRightIndent(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("parspacingbefore"), wxEmptyString);
|
value = node->GetAttribute(wxT("parspacingbefore"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetParagraphSpacingBefore(wxAtoi(value));
|
attr.SetParagraphSpacingBefore(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("parspacingafter"), wxEmptyString);
|
value = node->GetAttribute(wxT("parspacingafter"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetParagraphSpacingAfter(wxAtoi(value));
|
attr.SetParagraphSpacingAfter(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("linespacing"), wxEmptyString);
|
value = node->GetAttribute(wxT("linespacing"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetLineSpacing(wxAtoi(value));
|
attr.SetLineSpacing(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bulletstyle"), wxEmptyString);
|
value = node->GetAttribute(wxT("bulletstyle"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetBulletStyle(wxAtoi(value));
|
attr.SetBulletStyle(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bulletnumber"), wxEmptyString);
|
value = node->GetAttribute(wxT("bulletnumber"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetBulletNumber(wxAtoi(value));
|
attr.SetBulletNumber(wxAtoi(value));
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bulletsymbol"), wxEmptyString);
|
value = node->GetAttribute(wxT("bulletsymbol"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
wxChar ch = wxAtoi(value);
|
wxChar ch = wxAtoi(value);
|
||||||
@@ -1160,31 +1160,31 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
attr.SetBulletText(s);
|
attr.SetBulletText(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bullettext"), wxEmptyString);
|
value = node->GetAttribute(wxT("bullettext"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetBulletText(value);
|
attr.SetBulletText(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bulletfont"), wxEmptyString);
|
value = node->GetAttribute(wxT("bulletfont"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetBulletFont(value);
|
attr.SetBulletFont(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("bulletname"), wxEmptyString);
|
value = node->GetAttribute(wxT("bulletname"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetBulletName(value);
|
attr.SetBulletName(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("url"), wxEmptyString);
|
value = node->GetAttribute(wxT("url"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetURL(value);
|
attr.SetURL(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("parstyle"), wxEmptyString);
|
value = node->GetAttribute(wxT("parstyle"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetParagraphStyleName(value);
|
attr.SetParagraphStyleName(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("liststyle"), wxEmptyString);
|
value = node->GetAttribute(wxT("liststyle"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
attr.SetListStyleName(value);
|
attr.SetListStyleName(value);
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("tabs"), wxEmptyString);
|
value = node->GetAttribute(wxT("tabs"), wxEmptyString);
|
||||||
if (!value.empty())
|
if (!value.empty())
|
||||||
{
|
{
|
||||||
wxArrayInt tabs;
|
wxArrayInt tabs;
|
||||||
@@ -1197,13 +1197,13 @@ bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool is
|
|||||||
attr.SetTabs(tabs);
|
attr.SetTabs(tabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("pagebreak"), wxEmptyString);
|
value = node->GetAttribute(wxT("pagebreak"), wxEmptyString);
|
||||||
if (!value.IsEmpty())
|
if (!value.IsEmpty())
|
||||||
{
|
{
|
||||||
attr.SetPageBreak(wxAtoi(value) != 0);
|
attr.SetPageBreak(wxAtoi(value) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = node->GetPropVal(wxT("outlinelevel"), wxEmptyString);
|
value = node->GetAttribute(wxT("outlinelevel"), wxEmptyString);
|
||||||
if (!value.IsEmpty())
|
if (!value.IsEmpty())
|
||||||
{
|
{
|
||||||
attr.SetOutlineLevel(wxAtoi(value) != 0);
|
attr.SetOutlineLevel(wxAtoi(value) != 0);
|
||||||
|
@@ -49,9 +49,9 @@ static bool wxIsWhiteOnly(const wxString& buf);
|
|||||||
|
|
||||||
wxXmlNode::wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
|
wxXmlNode::wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
|
||||||
const wxString& name, const wxString& content,
|
const wxString& name, const wxString& content,
|
||||||
wxXmlProperty *props, wxXmlNode *next)
|
wxXmlAttribute *attrs, wxXmlNode *next)
|
||||||
: m_type(type), m_name(name), m_content(content),
|
: 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)
|
m_children(NULL), m_next(next)
|
||||||
{
|
{
|
||||||
if (m_parent)
|
if (m_parent)
|
||||||
@@ -69,7 +69,7 @@ wxXmlNode::wxXmlNode(wxXmlNode *parent,wxXmlNodeType type,
|
|||||||
wxXmlNode::wxXmlNode(wxXmlNodeType type, const wxString& name,
|
wxXmlNode::wxXmlNode(wxXmlNodeType type, const wxString& name,
|
||||||
const wxString& content)
|
const wxString& content)
|
||||||
: m_type(type), m_name(name), m_content(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)
|
m_children(NULL), m_next(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -89,8 +89,8 @@ wxXmlNode::~wxXmlNode()
|
|||||||
delete c;
|
delete c;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxXmlProperty *p, *p2;
|
wxXmlAttribute *p, *p2;
|
||||||
for (p = m_properties; p; p = p2)
|
for (p = m_attrs; p; p = p2)
|
||||||
{
|
{
|
||||||
p2 = p->GetNext();
|
p2 = p->GetNext();
|
||||||
delete p;
|
delete p;
|
||||||
@@ -99,7 +99,7 @@ wxXmlNode::~wxXmlNode()
|
|||||||
|
|
||||||
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
|
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
|
||||||
{
|
{
|
||||||
wxDELETE(m_properties);
|
wxDELETE(m_attrs);
|
||||||
wxDELETE(m_children);
|
wxDELETE(m_children);
|
||||||
DoCopy(node);
|
DoCopy(node);
|
||||||
return *this;
|
return *this;
|
||||||
@@ -119,49 +119,49 @@ void wxXmlNode::DoCopy(const wxXmlNode& node)
|
|||||||
n = n->GetNext();
|
n = n->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_properties = NULL;
|
m_attrs = NULL;
|
||||||
wxXmlProperty *p = node.m_properties;
|
wxXmlAttribute *p = node.m_attrs;
|
||||||
while (p)
|
while (p)
|
||||||
{
|
{
|
||||||
AddProperty(p->GetName(), p->GetValue());
|
AddAttribute(p->GetName(), p->GetValue());
|
||||||
p = p->GetNext();
|
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;
|
if (attr->GetName() == attrName) return true;
|
||||||
prop = prop->GetNext();
|
attr = attr->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
prop = prop->GetNext();
|
attr = attr->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const
|
wxString wxXmlNode::GetAttribute(const wxString& attrName, const wxString& defaultVal) const
|
||||||
{
|
{
|
||||||
wxString tmp;
|
wxString tmp;
|
||||||
if (GetPropVal(propName, &tmp))
|
if (GetAttribute(attrName, &tmp))
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
return defaultVal;
|
return defaultVal;
|
||||||
@@ -248,48 +248,48 @@ bool wxXmlNode::RemoveChild(wxXmlNode *child)
|
|||||||
|
|
||||||
void wxXmlNode::AddProperty(const wxString& name, const wxString& value)
|
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)
|
if (m_attrs == NULL)
|
||||||
m_properties = prop;
|
m_attrs = attr;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxXmlProperty *p = m_properties;
|
wxXmlAttribute *p = m_attrs;
|
||||||
while (p->GetNext()) p = p->GetNext();
|
while (p->GetNext()) p = p->GetNext();
|
||||||
p->SetNext(prop);
|
p->SetNext(attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxXmlNode::DeleteProperty(const wxString& name)
|
bool wxXmlNode::DeleteProperty(const wxString& name)
|
||||||
{
|
{
|
||||||
wxXmlProperty *prop;
|
wxXmlAttribute *attr;
|
||||||
|
|
||||||
if (m_properties == NULL)
|
if (m_attrs == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
else if (m_properties->GetName() == name)
|
else if (m_attrs->GetName() == name)
|
||||||
{
|
{
|
||||||
prop = m_properties;
|
attr = m_attrs;
|
||||||
m_properties = prop->GetNext();
|
m_attrs = attr->GetNext();
|
||||||
prop->SetNext(NULL);
|
attr->SetNext(NULL);
|
||||||
delete prop;
|
delete attr;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxXmlProperty *p = m_properties;
|
wxXmlAttribute *p = m_attrs;
|
||||||
while (p->GetNext())
|
while (p->GetNext())
|
||||||
{
|
{
|
||||||
if (p->GetNext()->GetName() == name)
|
if (p->GetNext()->GetName() == name)
|
||||||
{
|
{
|
||||||
prop = p->GetNext();
|
attr = p->GetNext();
|
||||||
p->SetNext(prop->GetNext());
|
p->SetNext(attr->GetNext());
|
||||||
prop->SetNext(NULL);
|
attr->SetNext(NULL);
|
||||||
delete prop;
|
delete attr;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
p = p->GetNext();
|
p = p->GetNext();
|
||||||
@@ -469,7 +469,7 @@ static void StartElementHnd(void *userData, const char *name, const char **atts)
|
|||||||
const char **a = atts;
|
const char **a = atts;
|
||||||
while (*a)
|
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;
|
a += 2;
|
||||||
}
|
}
|
||||||
if (ctx->root == NULL)
|
if (ctx->root == NULL)
|
||||||
@@ -750,7 +750,7 @@ static void OutputNode(wxOutputStream& stream, wxXmlNode *node, int indent,
|
|||||||
wxMBConv *convMem, wxMBConv *convFile, int indentstep)
|
wxMBConv *convMem, wxMBConv *convFile, int indentstep)
|
||||||
{
|
{
|
||||||
wxXmlNode *n, *prev;
|
wxXmlNode *n, *prev;
|
||||||
wxXmlProperty *prop;
|
wxXmlAttribute *attr;
|
||||||
|
|
||||||
switch (node->GetType())
|
switch (node->GetType())
|
||||||
{
|
{
|
||||||
@@ -768,14 +768,14 @@ static void OutputNode(wxOutputStream& stream, wxXmlNode *node, int indent,
|
|||||||
OutputString(stream, wxT("<"));
|
OutputString(stream, wxT("<"));
|
||||||
OutputString(stream, node->GetName());
|
OutputString(stream, node->GetName());
|
||||||
|
|
||||||
prop = node->GetProperties();
|
attr = node->GetAttributes();
|
||||||
while (prop)
|
while (attr)
|
||||||
{
|
{
|
||||||
OutputString(stream, wxT(" ") + prop->GetName() + wxT("=\""));
|
OutputString(stream, wxT(" ") + attr->GetName() + wxT("=\""));
|
||||||
OutputStringEnt(stream, prop->GetValue(), convMem, convFile,
|
OutputStringEnt(stream, attr->GetValue(), convMem, convFile,
|
||||||
XML_ESCAPE_QUOTES);
|
XML_ESCAPE_QUOTES);
|
||||||
OutputString(stream, wxT("\""));
|
OutputString(stream, wxT("\""));
|
||||||
prop = prop->GetNext();
|
attr = attr->GetNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->GetChildren())
|
if (node->GetChildren())
|
||||||
|
@@ -72,7 +72,7 @@ wxObject *wxCheckListBoxXmlHandler::DoCreateResource()
|
|||||||
{ n = n->GetNext(); continue; }
|
{ n = n->GetNext(); continue; }
|
||||||
|
|
||||||
// checking boolean is a bit ugly here (see GetBool() )
|
// 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();
|
v.MakeLower();
|
||||||
if (v == wxT("1"))
|
if (v == wxT("1"))
|
||||||
control->Check( i, true );
|
control->Check( i, true );
|
||||||
|
@@ -103,12 +103,12 @@ bool wxOwnerDrawnComboBoxXmlHandler::CanHandle(wxXmlNode *node)
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
// Avoid GCC bug - this fails on certain GCC 3.3 and 3.4 builds for an unknown reason
|
// 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
|
// 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
|
// 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
|
// 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 ||
|
return (fOurClass ||
|
||||||
(m_insideBox && node->GetName() == wxT("item")));
|
(m_insideBox && node->GetName() == wxT("item")));
|
||||||
#endif
|
#endif
|
||||||
|
@@ -109,10 +109,10 @@ wxObject *wxRadioBoxXmlHandler::DoCreateResource()
|
|||||||
wxString str = GetNodeContent(m_node);
|
wxString str = GetNodeContent(m_node);
|
||||||
|
|
||||||
wxString tooltip;
|
wxString tooltip;
|
||||||
m_node->GetPropVal(wxT("tooltip"), &tooltip);
|
m_node->GetAttribute(wxT("tooltip"), &tooltip);
|
||||||
|
|
||||||
wxString helptext;
|
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)
|
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||||
{
|
{
|
||||||
|
@@ -351,7 +351,7 @@ static void ProcessPlatformProperty(wxXmlNode *node)
|
|||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
isok = false;
|
isok = false;
|
||||||
if (!c->GetPropVal(wxT("platform"), &s))
|
if (!c->GetAttribute(wxT("platform"), &s))
|
||||||
isok = true;
|
isok = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -481,7 +481,7 @@ bool wxXmlResource::UpdateResources()
|
|||||||
{
|
{
|
||||||
long version;
|
long version;
|
||||||
int v1, v2, v3, v4;
|
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"));
|
wxT("version"), wxT("0.0.0.0"));
|
||||||
if (wxSscanf(verstr.c_str(), wxT("%i.%i.%i.%i"),
|
if (wxSscanf(verstr.c_str(), wxT("%i.%i.%i.%i"),
|
||||||
&v1, &v2, &v3, &v4) == 4)
|
&v1, &v2, &v3, &v4) == 4)
|
||||||
@@ -534,20 +534,20 @@ wxXmlNode *wxXmlResource::DoFindResource(wxXmlNode *parent,
|
|||||||
if ( node->GetType() == wxXML_ELEMENT_NODE &&
|
if ( node->GetType() == wxXML_ELEMENT_NODE &&
|
||||||
(node->GetName() == wxT("object") ||
|
(node->GetName() == wxT("object") ||
|
||||||
node->GetName() == wxT("object_ref")) &&
|
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)
|
if (!classname || cls == classname)
|
||||||
return node;
|
return node;
|
||||||
// object_ref may not have 'class' property:
|
// object_ref may not have 'class' attribute:
|
||||||
if (cls.empty() && node->GetName() == wxT("object_ref"))
|
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())
|
if (refName.empty())
|
||||||
continue;
|
continue;
|
||||||
wxXmlNode* refNode = FindResource(refName, wxEmptyString, true);
|
wxXmlNode* refNode = FindResource(refName, wxEmptyString, true);
|
||||||
if (refNode &&
|
if (refNode &&
|
||||||
refNode->GetPropVal(wxT("class"), wxEmptyString) == classname)
|
refNode->GetAttribute(wxT("class"), wxEmptyString) == classname)
|
||||||
{
|
{
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@@ -601,34 +601,35 @@ wxXmlNode *wxXmlResource::FindResource(const wxString& name,
|
|||||||
|
|
||||||
static void MergeNodes(wxXmlNode& dest, wxXmlNode& with)
|
static void MergeNodes(wxXmlNode& dest, wxXmlNode& with)
|
||||||
{
|
{
|
||||||
// Merge properties:
|
// Merge attributes:
|
||||||
for (wxXmlProperty *prop = with.GetProperties(); prop; prop = prop->GetNext())
|
for ( wxXmlAttribute *attr = with.GetAttributes();
|
||||||
|
attr; attr = attr->GetNext() )
|
||||||
{
|
{
|
||||||
wxXmlProperty *dprop;
|
wxXmlAttribute *dattr;
|
||||||
for (dprop = dest.GetProperties(); dprop; dprop = dprop->GetNext())
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !dprop )
|
if ( !dattr )
|
||||||
dest.AddProperty(prop->GetName(), prop->GetValue());
|
dest.AddAttribute(attr->GetName(), attr->GetValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge child nodes:
|
// Merge child nodes:
|
||||||
for (wxXmlNode* node = with.GetChildren(); node; node = node->GetNext())
|
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;
|
wxXmlNode *dnode;
|
||||||
|
|
||||||
for (dnode = dest.GetChildren(); dnode; dnode = dnode->GetNext() )
|
for (dnode = dest.GetChildren(); dnode; dnode = dnode->GetNext() )
|
||||||
{
|
{
|
||||||
if ( dnode->GetName() == node->GetName() &&
|
if ( dnode->GetName() == node->GetName() &&
|
||||||
dnode->GetPropVal(wxT("name"), wxEmptyString) == name &&
|
dnode->GetAttribute(wxT("name"), wxEmptyString) == name &&
|
||||||
dnode->GetType() == node->GetType() )
|
dnode->GetType() == node->GetType() )
|
||||||
{
|
{
|
||||||
MergeNodes(*dnode, *node);
|
MergeNodes(*dnode, *node);
|
||||||
@@ -639,7 +640,7 @@ static void MergeNodes(wxXmlNode& dest, wxXmlNode& with)
|
|||||||
if ( !dnode )
|
if ( !dnode )
|
||||||
{
|
{
|
||||||
static const wxChar *AT_END = wxT("end");
|
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 )
|
if ( insert_pos == AT_END )
|
||||||
{
|
{
|
||||||
dest.AddChild(new wxXmlNode(*node));
|
dest.AddChild(new wxXmlNode(*node));
|
||||||
@@ -664,7 +665,7 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent,
|
|||||||
// handling of referenced resource
|
// handling of referenced resource
|
||||||
if ( node->GetName() == wxT("object_ref") )
|
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);
|
wxXmlNode* refNode = FindResource(refName, wxEmptyString, true);
|
||||||
|
|
||||||
if ( !refNode )
|
if ( !refNode )
|
||||||
@@ -705,7 +706,7 @@ wxObject *wxXmlResource::CreateResFromNode(wxXmlNode *node, wxObject *parent,
|
|||||||
|
|
||||||
wxLogError(_("No handler found for XML node '%s', class '%s'!"),
|
wxLogError(_("No handler found for XML node '%s', class '%s'!"),
|
||||||
node->GetName().c_str(),
|
node->GetName().c_str(),
|
||||||
node->GetPropVal(wxT("class"), wxEmptyString).c_str());
|
node->GetAttribute(wxT("class"), wxEmptyString).c_str());
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -759,10 +760,10 @@ wxObject *wxXmlResourceHandler::CreateResource(wxXmlNode *node, wxObject *parent
|
|||||||
wxWindow *myParentAW = m_parentAsWindow;
|
wxWindow *myParentAW = m_parentAsWindow;
|
||||||
|
|
||||||
m_instance = instance;
|
m_instance = instance;
|
||||||
if (!m_instance && node->HasProp(wxT("subclass")) &&
|
if (!m_instance && node->HasAttribute(wxT("subclass")) &&
|
||||||
!(m_resource->GetFlags() & wxXRC_NO_SUBCLASSING))
|
!(m_resource->GetFlags() & wxXRC_NO_SUBCLASSING))
|
||||||
{
|
{
|
||||||
wxString subclass = node->GetPropVal(wxT("subclass"), wxEmptyString);
|
wxString subclass = node->GetAttribute(wxT("subclass"), wxEmptyString);
|
||||||
if (!subclass.empty())
|
if (!subclass.empty())
|
||||||
{
|
{
|
||||||
for (wxXmlSubclassFactoriesList::compatibility_iterator i = wxXmlResource::ms_subclassFactories->GetFirst();
|
for (wxXmlSubclassFactoriesList::compatibility_iterator i = wxXmlResource::ms_subclassFactories->GetFirst();
|
||||||
@@ -775,7 +776,7 @@ wxObject *wxXmlResourceHandler::CreateResource(wxXmlNode *node, wxObject *parent
|
|||||||
|
|
||||||
if (!m_instance)
|
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!"),
|
wxLogError(_("Subclass '%s' not found for resource '%s', not subclassing!"),
|
||||||
subclass.c_str(), name.c_str());
|
subclass.c_str(), name.c_str());
|
||||||
}
|
}
|
||||||
@@ -783,7 +784,7 @@ wxObject *wxXmlResourceHandler::CreateResource(wxXmlNode *node, wxObject *parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_node = node;
|
m_node = node;
|
||||||
m_class = node->GetPropVal(wxT("class"), wxEmptyString);
|
m_class = node->GetAttribute(wxT("class"), wxEmptyString);
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
m_parentAsWindow = wxDynamicCast(m_parent, wxWindow);
|
m_parentAsWindow = wxDynamicCast(m_parent, wxWindow);
|
||||||
|
|
||||||
@@ -922,7 +923,7 @@ wxString wxXmlResourceHandler::GetText(const wxString& param, bool translate)
|
|||||||
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
if (m_resource->GetFlags() & wxXRC_USE_LOCALE)
|
||||||
{
|
{
|
||||||
if (translate && parNode &&
|
if (translate && parNode &&
|
||||||
parNode->GetPropVal(wxT("translate"), wxEmptyString) != wxT("0"))
|
parNode->GetAttribute(wxT("translate"), wxEmptyString) != wxT("0"))
|
||||||
{
|
{
|
||||||
return wxGetTranslation(str2, m_resource->GetDomain());
|
return wxGetTranslation(str2, m_resource->GetDomain());
|
||||||
}
|
}
|
||||||
@@ -986,7 +987,7 @@ int wxXmlResourceHandler::GetID()
|
|||||||
|
|
||||||
wxString wxXmlResourceHandler::GetName()
|
wxString wxXmlResourceHandler::GetName()
|
||||||
{
|
{
|
||||||
return m_node->GetPropVal(wxT("name"), wxT("-1"));
|
return m_node->GetAttribute(wxT("name"), wxT("-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1068,7 +1069,7 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param, const wxColour&
|
|||||||
if (clr.Ok())
|
if (clr.Ok())
|
||||||
return clr;
|
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());
|
v.c_str(), param.c_str());
|
||||||
return wxNullColour;
|
return wxNullColour;
|
||||||
}
|
}
|
||||||
@@ -1086,10 +1087,10 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param,
|
|||||||
wxXmlNode *bmpNode = GetParamNode(param);
|
wxXmlNode *bmpNode = GetParamNode(param);
|
||||||
if ( bmpNode )
|
if ( bmpNode )
|
||||||
{
|
{
|
||||||
wxString sid = bmpNode->GetPropVal(wxT("stock_id"), wxEmptyString);
|
wxString sid = bmpNode->GetAttribute(wxT("stock_id"), wxEmptyString);
|
||||||
if ( !sid.empty() )
|
if ( !sid.empty() )
|
||||||
{
|
{
|
||||||
wxString scl = bmpNode->GetPropVal(wxT("stock_client"), wxEmptyString);
|
wxString scl = bmpNode->GetAttribute(wxT("stock_client"), wxEmptyString);
|
||||||
if (scl.empty())
|
if (scl.empty())
|
||||||
scl = defaultArtClient;
|
scl = defaultArtClient;
|
||||||
else
|
else
|
||||||
@@ -1195,7 +1196,7 @@ wxXmlNode *wxXmlResourceHandler::GetParamNode(const wxString& param)
|
|||||||
|
|
||||||
bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
|
bool wxXmlResourceHandler::IsOfClass(wxXmlNode *node, const wxString& classname)
|
||||||
{
|
{
|
||||||
return node->GetPropVal(wxT("class"), wxEmptyString) == classname;
|
return node->GetAttribute(wxT("class"), wxEmptyString) == classname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -65,8 +65,8 @@ private:
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
if (node->GetName() == _T("object")
|
if (node->GetName() == _T("object")
|
||||||
&& node->GetPropVal(_T("class"),&classValue)
|
&& node->GetAttribute(_T("class"),&classValue)
|
||||||
&& node->GetPropVal(_T("name"),&nameValue))
|
&& node->GetAttribute(_T("name"),&nameValue))
|
||||||
{
|
{
|
||||||
m_wdata.Add(XRCWidgetData(nameValue,classValue));
|
m_wdata.Add(XRCWidgetData(nameValue,classValue));
|
||||||
}
|
}
|
||||||
@@ -409,8 +409,8 @@ wxArrayString XmlResApp::PrepareTempFiles()
|
|||||||
wxString classValue,nameValue;
|
wxString classValue,nameValue;
|
||||||
while(node){
|
while(node){
|
||||||
if(node->GetName() == _T("object")
|
if(node->GetName() == _T("object")
|
||||||
&& node->GetPropVal(_T("class"),&classValue)
|
&& node->GetAttribute(_T("class"),&classValue)
|
||||||
&& node->GetPropVal(_T("name"),&nameValue)){
|
&& node->GetAttribute(_T("name"),&nameValue)){
|
||||||
|
|
||||||
aXRCWndClassData.Add(
|
aXRCWndClassData.Add(
|
||||||
XRCWndClassData(nameValue,classValue,node)
|
XRCWndClassData(nameValue,classValue,node)
|
||||||
@@ -444,7 +444,7 @@ static bool NodeContainsFilename(wxXmlNode *node)
|
|||||||
// wxBitmapButton:
|
// wxBitmapButton:
|
||||||
wxXmlNode *parent = node->GetParent();
|
wxXmlNode *parent = node->GetParent();
|
||||||
if (parent != NULL &&
|
if (parent != NULL &&
|
||||||
parent->GetPropVal(_T("class"), _T("")) == _T("wxBitmapButton") &&
|
parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") &&
|
||||||
(name == _T("focus") ||
|
(name == _T("focus") ||
|
||||||
name == _T("disabled") ||
|
name == _T("disabled") ||
|
||||||
name == _T("selected")))
|
name == _T("selected")))
|
||||||
@@ -453,7 +453,7 @@ static bool NodeContainsFilename(wxXmlNode *node)
|
|||||||
// wxBitmap or wxIcon toplevel resources:
|
// wxBitmap or wxIcon toplevel resources:
|
||||||
if ( name == _T("object") )
|
if ( name == _T("object") )
|
||||||
{
|
{
|
||||||
wxString klass = node->GetPropVal(_T("class"), wxEmptyString);
|
wxString klass = node->GetAttribute(_T("class"), wxEmptyString);
|
||||||
if (klass == _T("wxBitmap") ||
|
if (klass == _T("wxBitmap") ||
|
||||||
klass == _T("wxIcon") ||
|
klass == _T("wxIcon") ||
|
||||||
klass == _T("data") )
|
klass == _T("data") )
|
||||||
@@ -463,7 +463,7 @@ static bool NodeContainsFilename(wxXmlNode *node)
|
|||||||
// URLs in wxHtmlWindow:
|
// URLs in wxHtmlWindow:
|
||||||
if ( name == _T("url") &&
|
if ( name == _T("url") &&
|
||||||
parent != NULL &&
|
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
|
// FIXME: this is wrong for e.g. http:// URLs
|
||||||
return true;
|
return true;
|
||||||
@@ -917,7 +917,7 @@ wxArrayString XmlResApp::FindStrings(wxXmlNode *node)
|
|||||||
// ...and known to contain translatable string
|
// ...and known to contain translatable string
|
||||||
{
|
{
|
||||||
if (!flagGettext ||
|
if (!flagGettext ||
|
||||||
node->GetPropVal(_T("translate"), _T("1")) != _T("0"))
|
node->GetAttribute(_T("translate"), _T("1")) != _T("0"))
|
||||||
{
|
{
|
||||||
arr.Add(ConvertText(n->GetContent()));
|
arr.Add(ConvertText(n->GetContent()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user