← Back to team overview

kicad-developers team mailing list archive

Re: wxWidgets requirement

 

On 08/17/2010 01:15 PM, Lorenzo Marcantonio wrote:
> It seems the version requirement for wxWidgets needs a bump...
>
> Today's merge from bzr fails compiling on XNODE::AddAttribute (which is
> available from 2.8.11).
>
> And of course I *only* have 2.8.10 :P
>
> Now rebuilding the world (tm)...
>
>   

Lorenzo,

Play around with the attached patch if you want to stick with the 2.8.10
version.

You may have to do some research on the #if condition, but it might be
OK now.

On newer wxWidgets these functions are already in wxXmlNode.  We are
adding them only to *older* wxWidgets versions, but at the XNODE level. 
We only use XNODE directly, not wxXmlNode.

Dick

=== modified file 'include/xnode.h'
--- include/xnode.h	2010-08-09 02:03:16 +0000
+++ include/xnode.h	2010-08-17 18:30:33 +0000
@@ -65,6 +65,27 @@
      * @throw IOError if a system error writing the output, such as a full disk.
      */
     virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError );
+
+#if wxABI_VERSION < 20811
+    wxString GetAttribute(const wxString& attrName,
+                         const wxString& defaultVal) const
+    {
+        return GetPropVal(attrName, defaultVal);
+    }
+    bool GetAttribute(const wxString& attrName, wxString *value) const
+    {
+        return GetPropVal(attrName, value);
+    }
+    void AddAttribute(const wxString& attrName, const wxString& value)
+    {
+        AddProperty(attrName, value);
+    }
+    wxXmlProperty* GetAttributes() const
+    {
+        return GetProperties();
+    }
+#endif // wx < 2.8.11
+
 };
 
 #endif  // _XATTR_H_


Follow ups

References