]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gdi.i
Commented out the bitmap-greying code until I have time to debug it
[wxWidgets.git] / wxPython / src / gdi.i
index 117d7c97796837d008e061d1f5ae1541c6518d97..29aca1dcacf3b95f31c3c093449d788bc2b76891 100644 (file)
@@ -643,6 +643,25 @@ public:
 
     %addmethods {
         void Append(const wxString& name, int red, int green, int blue) {
+            // first see if the name is already there
+            wxString cName = name;
+            cName.MakeUpper();
+            wxString cName2 = cName;
+            if ( !cName2.Replace("GRAY", "GREY") )
+                cName2.clear();
+
+            wxNode *node = self->First();
+            while ( node ) {
+                const wxChar *key = node->GetKeyString();
+                if ( cName == key || cName2 == key ) {
+                    wxColour* c = (wxColour *)node->Data();
+                    c->Set(red, green, blue);
+                    return;
+                }
+                node = node->Next();
+            }
+
+            // otherwise append the new colour
             self->Append(name.c_str(), new wxColour(red, green, blue));
         }
     }
@@ -1148,7 +1167,7 @@ public:
 //---------------------------------------------------------------------------
 
 
-#ifndef __WXGTK__
+#ifdef __WXMSW__
 
 %{
 #include <wx/metafile.h>
@@ -1248,7 +1267,9 @@ public:
     ~wxRegion();
 
     void Clear();
+#ifndef __WXMAC__
     bool Offset(wxCoord x, wxCoord y);
+#endif
 
     wxRegionContain Contains(long x, long y);
     %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);