]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/colordlg.cpp
removed asserts to suppress gcc 3.4 warnings about condition being always true
[wxWidgets.git] / src / msw / colordlg.cpp
index e3a124210cb28b57514dba32015cd570be147ad1..92036a89af7cf8b02da34be55c389e07c7cc984e 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "colordlg.h"
 #endif
 
@@ -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"
@@ -70,10 +70,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
 // colour dialog hook proc
 // ----------------------------------------------------------------------------
 
-UINT CALLBACK wxColourDialogHookProc(HWND hwnd,
-                                     UINT uiMsg,
-                                     WPARAM WXUNUSED(wParam),
-                                     LPARAM lParam)
+UINT_PTR CALLBACK
+wxColourDialogHookProc(HWND hwnd,
+                       UINT uiMsg,
+                       WPARAM WXUNUSED(wParam),
+                       LPARAM lParam)
 {
     if ( uiMsg == WM_INITDIALOG )
     {
@@ -127,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 )