]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/pen.cpp
Needed to add #include "wx/statusbr.h" to know that wxStatusBar is derived
[wxWidgets.git] / src / gtk1 / pen.cpp
index 11f787bd324d12392c91d48f3c38e350227e877e..721b850a9ff65cfafbb71b778ad9703dc6018a7c 100644 (file)
@@ -7,12 +7,11 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
-#ifdef __GNUG__
-#pragma implementation "pen.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #include "wx/pen.h"
+#include "wx/colour.h"
 
 #include <gdk/gdk.h>
 
@@ -42,20 +41,33 @@ public:
         m_capStyle = data.m_capStyle;
         m_colour = data.m_colour;
         m_countDashes = data.m_countDashes;
-/*
-        if (data.m_dash)  TODO
-            m_dash = new
-*/
         m_dash = data.m_dash;
     }
 
     bool operator == (const wxPenRefData& data) const
     {
-        return (m_style == data.m_style &&
-                m_width == data.m_width &&
-                m_joinStyle == data.m_joinStyle &&
-                m_capStyle == data.m_capStyle &&
-                m_colour == data.m_colour);
+        if ( m_countDashes != data.m_countDashes )
+            return FALSE;
+
+        if ( m_dash )
+        {
+            if ( !data.m_dash ||
+                 memcmp(m_dash, data.m_dash, m_countDashes*sizeof(wxGTKDash)) )
+            {
+                return FALSE;
+            }
+        }
+        else if ( data.m_dash )
+        {
+            return FALSE;
+        }
+
+
+        return m_style == data.m_style &&
+               m_width == data.m_width &&
+               m_joinStyle == data.m_joinStyle &&
+               m_capStyle == data.m_capStyle &&
+               m_colour == data.m_colour;
     }
             
     int        m_width;
@@ -117,7 +129,7 @@ void wxPen::SetDashes( int number_of_dashes, const wxDash *dash )
     AllocExclusive();
     
     M_PENDATA->m_countDashes = number_of_dashes;
-    M_PENDATA->m_dash = (wxGTKDash *)dash; /* TODO */
+    M_PENDATA->m_dash = (wxGTKDash *)dash;
 }
 
 void wxPen::SetColour( int red, int green, int blue )