]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/colourcmn.cpp
Fix setting the clipping region for a DC when the region is an
[wxWidgets.git] / src / common / colourcmn.cpp
index 3969790771510fde07ba214fc63e4c8601769740..a77017922fdc686a894c852fe1169226d0649df3 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/utils.h"
 #ifndef WX_PRECOMP
     #include "wx/log.h"
     #include "wx/utils.h"
+    #include "wx/gdicmn.h"
 #endif
 
 #endif
 
-#include "wx/gdicmn.h"
-
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT)
+#endif
 
 // ============================================================================
 // wxString <-> wxColour conversions
 
 // ============================================================================
 // wxString <-> wxColour conversions
@@ -54,10 +56,12 @@ bool wxColourBase::FromString(const wxChar *str)
     {
         // hexadecimal prefixed with # (HTML syntax)
         unsigned long tmp;
     {
         // hexadecimal prefixed with # (HTML syntax)
         unsigned long tmp;
-        if (wxSscanf(&str[1], wxT("%lX"), &tmp) != 1)
+        if (wxSscanf(&str[1], wxT("%lx"), &tmp) != 1)
             return false;
 
             return false;
 
-        Set(tmp);   // set from packed long
+        Set((unsigned char)(tmp >> 16),
+            (unsigned char)(tmp >> 8),
+            (unsigned char)tmp);
     }
     else if (wxTheColourDatabase) // a colour name ?
     {
     }
     else if (wxTheColourDatabase) // a colour name ?
     {