]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/colordlg.cpp
fixed wxImage->wxBitmap conversion for images with alpha channel
[wxWidgets.git] / src / msw / colordlg.cpp
index 467b05a3cde72232cdbfdeb7614d068a6dc57030..b7bbd4fb773722977fb9a59face6a7461bd8f42c 100644 (file)
@@ -42,7 +42,7 @@
     #include "wx/msgdlg.h"
 #endif
 
-#if wxUSE_COLOURDLG && !wxUSE_SMARTPHONE
+#if wxUSE_COLOURDLG && !defined(__SMARTPHONE__)
 
 #include "wx/msw/private.h"
 #include "wx/colordlg.h"
@@ -128,7 +128,12 @@ int wxColourDialog::ShowModal()
 
     int i;
     for (i = 0; i < 16; i++)
-      custColours[i] = wxColourToRGB(m_colourData.m_custColours[i]);
+    {
+        if (m_colourData.m_custColours[i].Ok())
+            custColours[i] = wxColourToRGB(m_colourData.m_custColours[i]);
+        else
+            custColours[i] = RGB(255,255,255);
+    }
 
     chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR);
     if ( m_parent )
@@ -147,10 +152,9 @@ int wxColourDialog::ShowModal()
     bool success = ::ChooseColor(&(chooseColorStruct)) != 0;
 
     // Try to highlight the correct window (the parent)
-    HWND hWndParent = 0;
     if (GetParent())
     {
-      hWndParent = (HWND) GetParent()->GetHWND();
+      HWND hWndParent = (HWND) GetParent()->GetHWND();
       if (hWndParent)
         ::BringWindowToTop(hWndParent);
     }